开发者

mootools fail to inject an element at bottom of another one on ie

If I try to inject an element at the bottom of another one

var div = new Element('div', { id: 'thediv' }开发者_Go百科).inject(anotherdiv, 'bottom');

I get

SCRIPT5007: Unable to get value of the property 'appendChild': object is null or undefined 
mootools-core-1.3.2-full-compat.js, line 3437 character 3

these are the lines which cause the error in mootools1.3.2

bottom: function(context, element){
    element.appendChild(context);
},

how can i solve this problem?


That is the error you get if anotherdiv doesn't have an appendChild method, such as if the script is run before anotherdiv exists, or has not been assigned a value that is a DOM element.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜