求dojo/domReady不能在sync loader下使用的原因

前端之家收集整理的这篇文章主要介绍了求dojo/domReady不能在sync loader下使用的原因前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
I saw there was a sentence "You should not use dojo/domReady! with modules that may be loaded with the legacy synchronous loader" in topic http://dojotoolkit.org/reference-guide/1.8/dojo/domReady.html .

It explains that domReady under sync loader may cause dojo/ready to invoke its callbacks even required modules are not loaded. I don't understand why.

My understanding is,Under sync loader,all module are loaded through XMLHttpRequest. They are loaded in a sequence. The sequence blocks DOM to parse. So,DOMContentLoaded event should always be fired at end. This means,Modules are all loaded before DomContentLoaded. dojo/domReady also means dojo/ready.

Am I wrong? Please correct me. 原文链接:https://www.f2er.com/dojo/291542.html

猜你在找的Dojo相关文章