Sha256: 637b7c76f29bb8504e4cf9b9b8c4afa99832ba9d7370673374c3e3d3023e22d2
Contents?: true
Size: 545 Bytes
Versions: 11
Compression:
Stored size: 545 Bytes
Contents
$.ajaxFormHandlers = {}; $.extend({ registerAjaxFormHandler: function(handlers) { $.extend($.ajaxFormHandlers, handlers); } }); $("form.ajaxify").live("submit", function(event) { var form = $(this); $.ajax({ type: form.attr("method") || "GET", url : form.attr("action") || window.location.href, data: form.serialize(), success: function(response) { var handler = $.ajaxFormHandlers[form.attr("name")]; if (handler) { handler(form, response); } } }); event.preventDefault(); });
Version data entries
11 entries across 11 versions & 1 rubygems