AjaxOn Attributes - dougflip/BladeJs GitHub Wiki
These HTML5 attributes provide you with a method to define data for individual AJAX requests. BladeJs handles all of the common wiring/plumbing and allows you to configure each request by specifying attribute values. This is the list of supported attributes, but notice that using a custom beforeSend callback allows you the flexibility to modify the request in any way you like before it is sent to the server.
- data-blade-url - specifies the URL of the ajax request. FORM tags may use the ACTION attribute instead.
- data-blade-on - specifies the event on which this is handled, forms defaulted to 'submit' all other elements to 'click'
- data-blade-data-type - specify the dataType property passed to the ajax request (xml, json, script, or html).
- data-blade-type - specify the type property passed to the ajax request.
- data-blade-before-send - set to the beforeSend callback of the jQuery request object - defaulted to $.fn.blade.defaults.ajaxBeforeSend
- data-blade-success - set to the success callback of the jQuery request object - defaulted to $.fn.blade.defaults.ajaxSuccess
- data-blade-error - set to the error callback of the jQuery request object - defaulted to $.fn.blade.defaults.ajaxError
- data-blade-serialize - value that is forwarded to blade's jQueryEval function to match a set of elements. Set to the "data" property of the request.
- data-blade-confirm - set to a callback which will be invoked after BladeJs has created the request object, but before it is passed to jQuery