i’have a js client with JQuery, this js call a page (GET HTTP) and set timeout. The aim of timeout is: ‘do something if the server not responds’. If i use Apache web server for manage a page, the timeout perform. If i use IIS 6.0 the timeout is ‘skipped’ and the page attempt (anyway) the server response. This is the script:
//client side
$.ajax({ type: 'GET', url: 'some.php', data: 'name=John&location=Boston', timeout: 5000 success: function(msg){ alert( 'Data Saved: ' + msg ); }, error: function(request, errorType, errorThrown){ alert('opppsssss .... '); } });
I suppose that is a IIS..is it right? or i made a mistake in JQuery code?
best regerds
Domenico
As Paolo mentioned in a comment, you’re missing a comma after the timeout declaration. I very recently had a situation where a missing comma in an object declaration like that would cause IE to choke on the script and not run it properly (while firefox had no problems running it).
That wouldn’t explain why the different servers would be causing different behavior, but it would probably be worth fixing that first and retesting, as the behavior might change and might be easier to debug.