最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Is there any maximumminimum timeout for the xmlhttprequest? - Stack Overflow

programmeradmin4浏览0评论

Is there any maximum timeout for the xmlhttprequest ? Currently its not possible to set timeout value more than 1 minute in chrome. let xmlHttpRequest: XMLHttpRequest = new XMLHttpRequest(); xmlHttpRequest.timeout = 120000;

Is there any maximum timeout for the xmlhttprequest ? Currently its not possible to set timeout value more than 1 minute in chrome. let xmlHttpRequest: XMLHttpRequest = new XMLHttpRequest(); xmlHttpRequest.timeout = 120000;

Share Improve this question asked Mar 15, 2017 at 0:10 MadhuMadhu 1323 silver badges10 bronze badges 1
  • what happens if you do – Jaromanda X Commented Mar 15, 2017 at 0:54
Add a ment  | 

2 Answers 2

Reset to default 4

Yes, there is a maximum timeout for xmlhttprequest in chrome, and that is 1 minute. Unfortunately you can not increase the timeout by setting the timeout property of xmlhttprequest in chrome. But if you are on windows, you might possibly set the maixmum tmeout with the help of regedit, and the steps are ...

  • press window + r > type regedit > press enter
  • navigate to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\InternetSettings
  • create a DWORD vale named KeepAliveTimeout and set the data value 120000 (2 min.)
  • create another value named ServerInfoTimeout, following the same steps
  • restart PC

No, the XMLHttpRequest object does not have a maximum timeout value, because the default timeout value is 0, meaning infinite.

Source: https://developer.mozilla/en-US/docs/Web/API/XMLHttpRequest/timeout

You mentioned Chrome: the network stack you are on does have timeout limitations.

Google Chrome will not let you change the default timeout values.

发布评论

评论列表(0)

  1. 暂无评论