declarative ui - Download Create Interactive Declarative UIs In jQuery - jqDeclare

Download Create Interactive Declarative UIs In jQuery – jqDeclare

Posted on

This time I will share jQuery Plugin and tutorial about Create Interactive Declarative UIs In jQuery – jqDeclare, hope it will help you in programming stack.

declarative ui - Download Create Interactive Declarative UIs In jQuery - jqDeclare
File Size: 4.36 KB
Views Total: 279
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

The jqDeclare library helps developers to create React-style interactive, declarative web interfaces in jQuery.

The library allows you to dynamically update the UI according to the state. Without the need of manipulating the DOM directly.

Basic usage:

1. To get started, include the jqDeclare plugin after jQuery.

1 <script src="/path/to/jquery.slim.min.js"></script>
2 <script src="/path/to/jquery.declare.js"></script>

2. Create an alert popup along with a button. In this example, when you click the button it displays an alert popup:

1 $("#example").declare(function (name) {
2   return ["button", {"click": function(ev) { alert("Hello " + name); }}, "Say hello"];
3 }).render("jQueryScript");

3. Full JavaScript syntax:

01 // jQuery object
02 $("#example").declare($("<p>Hello World!</p>").click(callback));
03  
04 // Or jqDeclare definition
05 $("#example").declare(["p", {"click": callback}, "Hello World!"]);
06  
07 // function
08 $("#example").declare(function(data) {
09   // ..
10 }).render(data);

This awesome jQuery plugin is developed by chr15m. For more Advanced Usages, please check the demo page or visit the official website.

source : jquery.net