eldarion / eldarion-ajax

a library for adding declarative ajax functionality to your website
BSD 3-Clause "New" or "Revised" License
758 stars 153 forks source link

please make work on html5 <button /> #85

Closed silascardoso closed 7 years ago

silascardoso commented 9 years ago

please make work on button

silascardoso commented 9 years ago

I got it

$(function () {
    $('body').on('click', 'a.ajax', Ajax.prototype.click);
    $('body').on('submit', 'form.ajax', Ajax.prototype.submit);
    $('body').on('click', 'a[data-cancel-closest]', Ajax.prototype.cancel);
    $('body').on('click', 'button.ajax', Ajax.prototype.button);

    $('[data-timeout]').each(Ajax.prototype.timeout);
    $('[data-interval]').each(Ajax.prototype.interval);
});

Ajax.prototype.button = function (e) { var $this = $(this), url = $this.attr('formaction'), method = $this.data('method') //... }

Use: