Demo
<script src="path/to/jquery.js"></script> <script src="path/to/jQuery-prompt21.js"></script> <script> var p = $(".popup").prompt21(); $(".show-popup").on("click", function () { p.getData(function (err, data) { $(".result").text(JSON.stringify(data, null, 2)); }); }); </script>
Click the "Prompt Popup" button.
Documentation
unflattenObject(flat)
Converts a flat object to an unflatten one
Params
- Object
flat
: The flat object that should be converted
Return
- Object Unflatten object
prompt21(opt_options)
Initializes a new instance of Prompt21.
Example:
var p21 = $(".container").prompt21();
Params
- Object
opt_options
: The options for Prompt21 instance.cancel
(String): The cancel button jQuery selector (default:"button.cancel"
).showEffect
(String): The effect applied to the show function (default:".fadeIn"
).hideEffect
(String): The effect applied to the hide function (default:".fadeOut"
).form
(String): The form jQuery selector (default:"form"
).
Return
- Prompt21 An object containing:
getData
(Function): ThegetData
function. See below.
getData(callback)
Shows the popup and calls the callback function when the OK button is clicked.
Params
- Function
callback
: The callback function.