Why would you ever want to use $(window).unload(function(){});
over $(window).bind('beforeunload', function(){});
And is there a difference between binding the beforeunload using jQuery like above, and assigning it directly like this: window.onbeforeunload = function() { };