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.
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:
02 |
$( "#example" ).declare($( "<p>Hello World!</p>" ).click(callback)); |
05 |
$( "#example" ).declare([ "p" , { "click" : callback}, "Hello World!" ]); |
08 |
$( "#example" ).declare( function (data) { |
This awesome jQuery plugin is developed by chr15m. For more Advanced Usages, please check the demo page or visit the official website.