开发者

Onreadystatechange callback behaviour for XMLHttpRequest

If XMLHttpRequest is used with asynchronous mode, then are the onreadystatechange callbacks for 0,1,2 states called in UI thread only or in the background thread?

And is it possible that this behaviour could be different in different browsers?

开发者_JAVA百科

Best Regards, Keshav


Unless you're specifically using background workers (which are browser extensions and not universally implemented yet; i.e. you'd know if you were using them), everything will always run in the same thread. That's how JavaScript works.

Of course, some implementations might optimize things by running JS in a separate thread, but this will always be invisible to you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜