当前位置 : 主页 > 网页制作 > Dojo >

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

来源:互联网 收集:自由互联 发布时间:2021-06-15
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
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.
网友评论