8

I was trying out example jQuery examples and to my surprise, I got an error state for an AJAX call mentioning that timeout isn't defined. When I removed timeout attribute, it worked fine. I downloaded jQuery few days back, so I am pretty sure it's not a version problem.

I was trying with Firefox(3.6.8) and not any other browser.

Why would this occur?

Edit: Code snippet moved from the comments to the 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) { } 
});
1
  • 4
    Can you put a snipset of code here? Commented Aug 3, 2010 at 8:19

1 Answer 1

9
+50

The timeout property has been present in jQuery for a long time so I don't think that your problem is related to it. Maybe 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) { 

    } 
});
Sign up to request clarification or add additional context in comments.

2 Comments

I have tried it couple of times and I too am surprised that it wasn't working. It was happening at my office PC. Well let me try that now and see if things are working.
Looks to work here at my PC. I guess you are right, must have missed out something.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.