使用dom-construct.place时的TypeError(空引用异常)

时间:2015-01-29 19:59:23

标签: javascript dojo

  

TypeError:无法读取属性' ownerDocument'为null   {stack:(...),message:"无法读取属性' ownerDocument' of null"}

升级dojo后,在以下行中遇到上述错误。有谁知道我如何解决它,或者我应该将其报告为错误?

require([..., "dojo/dom-construct"], function(..., domConstruct) {
    //some code
    domConstruct.place(legPic, curLayer.id + '_chkBox_' + curLegLyr.layerId, "after");
});

1 个答案:

答案 0 :(得分:0)

curLayer.id + '_chkBox_' + curLegLyr.layerId可能会在您domConstruct.place来电时引用您文档中实际不存在的ID。

(错误对应于Dojo源中的this line。)