this.dragCommand = document.createElement("div");this.dragCommand = {
innerHTML : "<img src='images/pan1.gif'></img>",
onclick : function(){},
className : "commandBtn",
};出错信息:
Error: uncaught exception: [Exception... "Node cannot be inserted at the specified point in the hierarchy" code: "3" nsresult: "0x80530003 (NS_ERROR_DOM_HIERARCHY_REQUEST_ERR)" location: "http://127.0.0.1:8000/javascripts/MapHelper.js Line: 184"]下面是184行代码:
this.commandPane.appendChild(this.dragCommand);
innerHTML : "<img src='images/pan1.gif'></img>",
onclick : function(){},
className : "commandBtn",
};出错信息:
Error: uncaught exception: [Exception... "Node cannot be inserted at the specified point in the hierarchy" code: "3" nsresult: "0x80530003 (NS_ERROR_DOM_HIERARCHY_REQUEST_ERR)" location: "http://127.0.0.1:8000/javascripts/MapHelper.js Line: 184"]下面是184行代码:
this.commandPane.appendChild(this.dragCommand);
解决方案 »
- 在线等大神解答哈,请问如何下载rtmpt协议开头的视频哈?在线等大神,人气积分伺候着呢哈!!!
- 请问51job城市选择的JS怎么用?
- ext Tree如何获取没有被展开的子结点
- ***************************prototype写在里面和外面有区别吗???
- 鼠标变化
- jQuery ScrollPagination滚动时会重复加载数据,求解决办法 ?
- 这个选择省份和城市的javascript
- 困惑问题-------关于字符串的连接
- 如何固定frame的大小
- 我才开始学习作web程序,其中看到很多的地方都用到了jsp,现在想学开如何入手>>>>>
- 怎样使用户访问的js,是最新的js,而不是缓存中的js??
- 请教大家,这段我看不明白呢!!
innerHTML : " <img src='images/pan1.gif'> </img> ",
onclick : function(){},
className : "commandBtn",
}; this.dragCommand
2个变量名是一样的?
后面是想给这个DIV赋值,不知道这样写对不?
innerHTML : " <img src='images/pan1.gif'> </img> ",
onclick : function(){},
className : "commandBtn",
}; 你把this.dragCommand这个DOM节点对象变成了另外一个普通自定义对象然后你又
this.commandPane.appendChild(this.dragCommand);因为this.dragCommand类型被你改变了,所以提示Node cannot be inserted错误=========================================
这么写
this.dragCommand = document.createElement("div");this.dragCommand.onclick=function(){};
this.dragCommand.className='commandBtn';
this.dragCommand.innerHTML='<img src="images/pan1.gif"> </img>';
拆开写的意思是给this.dragCommand的属性赋值你那写法是给this.dragCommand赋值,差别比较细微
innerHTML : " <img src='images/pan1.gif'> </img>";
onclick : function(){};
className : "commandBtn";
};this.commandPane.appendChild(this.dragCommand);