jquery - What does AJAX timeout actually measure? -


i have several jquery , angularjs ajax calls in code timeout values such (jquery):

$.ajax({     url: url,     type: "post",     datatype: "xml",     timeout : 5000,     data: data }); 

or (angular):

$http.post(url, data, {timeout:5000}).then(function(response){}); 

my question timeout parameter measure? have varied timeout , ran various tests. monitored network requests in browser made me more confused. noticed measurements noted in timeline not predictors of whether or not request timeline. example, can have request on order of milliseconds triggers timeout timeout parameter set 5 seconds. there @ least 1 other factor @ play here , not networking expert know is.

set timeout (in milliseconds) request. override global timeout set $.ajaxsetup(). timeout period starts @ point $.ajax call made; if several other requests in progress , browser has no connections available, possible request time out before can sent. in jquery 1.4.x , below, xmlhttprequest object in invalid state if request times out; accessing object members may throw exception. in firefox 3.0+ only, script , jsonp requests cannot cancelled timeout; script run if arrives after timeout period.

this jquery ajax says.

that said, time factor dependent on every stack browser network. hard give specific answer unless have clear defined experiment.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -