var objDiv=document.createElement("div")
objDiv.style.behavior="other.htc";
//这里先使用object.appendChild()或者object.insertBefore()方法将元素objDiv插入到页面中试试?
objDiv.doThing();//报错
objDiv.style.behavior="other.htc";
//这里先使用object.appendChild()或者object.insertBefore()方法将元素objDiv插入到页面中试试?
objDiv.doThing();//报错
var objDiv=document.createElement("div")
objDiv.id = uniqueID + "div";
objDiv.style.behavior="other.htc";
setTimeout(objDiv.id + ".doThing();", 10);
就不出错了。更好的办法是当objDiv的onreadystatechange触发时,检查readyState是否为"complete",当为"complete"时,再调用方法就可以了。