X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fajax.js;h=8262bc7ad886f62cd3d21accada5e6fdd57fb479;hb=68b49cf4273ce500e2666616771e2731c6833bca;hp=c255dfebaaeafb6247a13e29eb2d1d4453b57722;hpb=434b87b8a233eb24ec773de801f3adb460fbd0f4;p=jquery.git diff --git a/src/ajax.js b/src/ajax.js index c255dfe..8262bc7 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -143,13 +143,15 @@ jQuery.extend({ url: location.href, global: true, type: "GET", - timeout: 0, contentType: "application/x-www-form-urlencoded", processData: true, async: true, + /* + timeout: 0, data: null, username: null, password: null, + */ // Create the request object; Microsoft failed to properly // implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available // This function can be overriden by calling jQuery.ajaxSetup @@ -378,6 +380,9 @@ jQuery.extend({ // Fire the complete handlers complete(); + if ( isTimeout ) + xhr.abort(); + // Stop memory leaks if ( s.async ) xhr = null; @@ -392,14 +397,8 @@ jQuery.extend({ if ( s.timeout > 0 ) setTimeout(function(){ // Check to see if the request is still happening - if ( xhr ) { - if( !requestDone ) - onreadystatechange( "timeout" ); - - // Cancel the request - if ( xhr ) - xhr.abort(); - } + if ( xhr && !requestDone ) + onreadystatechange( "timeout" ); }, s.timeout); }