I\'ve been observing some strange behavior with the following code:
$.fn.submit_to_remote = function() {
// I use .each instead of the .submit directly so
Yes, I agree with Seb, it's a good practice, in my opinion to always unbind before binding unless you are certain that there aren't currently binds to your element that you want. You can double bind your stuff on accident by simply using the '.submit', '.click', '.mouseover', etc... functions.
Get into the habit of doing this (never fails for me):
$('.some_element').unbind('submit').bind('submit',function() {
// do stuff here...
});
... instead of:
$('.some_element').submit(function() {
// do stuff here...
});