JQuery timeout AJAX undefined

I tested jQuery examples and, to my surprise, I got an error state for an AJAX call, which mentioned that the timeout was not defined. When I removed the timeout attribute, it worked fine. I downloaded jQuery a few days ago, so I'm sure this is not a version issue.

I tried with Firefox (3.6.8) and not with another browser.

Why is this happening?

Edit : code snippet moved from comments to question

$.ajax({ type: "GET", dataType: 'json', url: PHPServiceProxy, timeout: 5000, success: function(reply) { } // note: original code snippet provided was missing a comma here. error: function (xhr, textStatus, errorThrown) { } }); 
+7
jquery ajax timeout
Aug 03 '10 at 8:17
source share
1 answer

The timeout property has been present in jQuery for a long time, so I don’t think your problem is with it. Perhaps you have a syntax error in your code. This should work:

 $.ajax({ type: 'GET', dataType: 'json', url: PHPServiceProxy, timeout: 5000, success: function(reply) { }, error: function (xhr, textStatus, errorThrown) { } }); 
+8
Sep 04 '10 at 10:26
source share



All Articles