简体   繁体   English

XHR 调用是宏任务还是微任务?

[英]An XHR call is it a macrotask or a microtask?

Ajax calls are they scheduled as microtasks or macrotasks ? Ajax 调用是作为微任务还是宏任务安排的?

And is there any difference between browsers.浏览器之间有什么区别。

In the book Secrets of the JavaScript Ninja, 2nd Edition, the author state that the Network events are scheduled as Macrotasks.在 JavaScript Ninja 的秘密,第 2 版一书中,作者指出网络事件被安排为宏任务。

So, an XHR callback is queued with Macrotasks.因此,XHR 回调与宏任务一起排队。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM