Ajax “的范围是多少?”;“脚本执行”;dom.max脚本运行时间

Ajax “的范围是多少?”;“脚本执行”;dom.max脚本运行时间,ajax,firefox,Ajax,Firefox,我正在阅读Dom.max\u script\u run\u time的Firefox配置设置 默认设置为10秒 我的ajax超时也设置为10秒 我知道ajax超时计数从发送xmlhttp请求开始,直到响应返回 但是我不确定Firefox Dom.max脚本运行时间是否包括ajax等待响应的时间 例如: 1. user click on the button on the web page. 2. onclick event is triggered (Dom.max_script_run_t

我正在阅读Dom.max\u script\u run\u time的Firefox配置设置

默认设置为10秒

我的ajax超时也设置为10秒

我知道ajax超时计数从发送xmlhttp请求开始,直到响应返回

但是我不确定Firefox Dom.max脚本运行时间是否包括ajax等待响应的时间

例如:

1. user click on the button on the web page.

2. onclick event is triggered (Dom.max_script_run_time start?)

3. js grag input form data and construct JSON.

4. Using the JSON string, send ajax request.

5. main js thread ends. (Dom.max_script_run_time end here???)

6. xmlHttpRequest object still waiting for the ajax response back from the server.

7. xmlHttpRequest object receives response from the server.

8. Display response text on the web page (part of ajax callback) (Dom.max_script_run_time end here???)

Dom.max_脚本_run_时间是否会因为ajax是另一个线程而在主js线程结束时停止?(即,脚本执行是按线程计时的?

最大脚本运行时间涵盖脚本离开事件循环的时间。这个想法是让用户杀死“挂起”的脚本


因此,如果您执行异步XHR,它应该不会是一个问题(因为在
send()
和启动浏览器的回调之间,可以自由处理用户事件等等,因此您的脚本从用户角度看不会“挂起”)

那么,在我的问题中,脚本的最大运行时间是否在#5结束?如果我正确理解您的设置的话(关于“线程”的讨论令人困惑,因为JS只有一个线程,modulo workers),那么是的。啊,看。我不知道JS只有一个线程。谢谢澄清。