/ Published in: JavaScript
URL: http://railscasts.com/episodes/136-jquery
Adapted from Railscasts
Use like $("myElement").submitWithAjax() to add unobtrusive submission via Ajax to your forms.
Expand |
Embed | Plain Text
jQuery.fn.submitWithAjax = function() { this.submit(function() { $.post(this.action, $(this).serialize(), null, "script"); return false; }); return this; };
You need to login to post a comment.
