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.
精彩评论