1 if (self.jQuery) 2 { 3 if (self.jQuery.ajax) 4 { 5 jQuery(document).ready(function() 6 { 7 jQuery.ajaxSetup( 8 { 9 beforeSend: function(xhr) 10 { 11 jQuery(window).bind('beforeunload', 12 function() 13 { 14 xhr.abort(); 15 } 16 ); 17 } 18 }); 19 }); 20 } 21 }