求dojo/domReady不能在sync loader下使用的原因
发布时间:2020-12-16 21:42:00 所属栏目:百科 来源:网络整理
导读: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. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |