dijit.byId doesn't work on IE8 with dojo.addOnLoad

泪湿孤枕 提交于 2019-12-11 00:35:13

问题


When I load this script with IE8, I've got exception Object does not support this property or method. But it works with other browsers.

I use dijit 1.3.1 and I don't understand.

dojo.addOnLoad(init);
var DG;
var datas;

function init(){
    DG = dijit.byId("DG");
}

I've had parseOnload: true but it changes anything.

<script type="text/javascript" src="dojo/dojo.js"
        djConfig="parseOnLoad: true">
</script>

回答1:


This migth probably not fix the problem, but the function init() is used before it was declared. Try this:

    var DG;
    var datas;

    function init(){
        DG = dijit.byId("DG");
    }

    dojo.addOnLoad(init);

Does it work?



来源:https://stackoverflow.com/questions/13365287/dijit-byid-doesnt-work-on-ie8-with-dojo-addonload

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!