insertAdjacentElement方法在firefox中报错
来源:互联网 发布:java反序列化 time 编辑:程序博客网 时间:2024/06/05 15:40
原来使用的一个js控件,在firefox3.5.5环境下使用时报错:
container.insertAdjacentElement is not a function
原来是firefox没有定义insertAdjacentElement 这个方法,只能自己重定义了,在该控件的脚本中加入以下片段:
HTMLElement.prototype.insertAdjacentElement=function(where,parsedNode){
switch(where){
case "beforeBegin":
this.parentNode.insertBefore(parsedNode,this);
break;
case "afterBegin":
this.insertBefore(parsedNode,this.firstChild);
break;
case "beforeEnd":
this.appendChild(parsedNode);
break;
case "afterEnd":
if(this.nextSibling)
this.parentNode.insertBefore(parsedNode,this.nextSibling);
else
this.parentNode.appendChild(parsedNode);
break;
}
}
报错信息不再出现。
- insertAdjacentElement方法在firefox中报错
- insertAdjacentElement方法
- insertAdjacentElement方法
- insertAdjacentElement方法
- firefox中如何调用insertAdjacentElement()
- insertAdjacentElement方法使用
- object.insertAdjacentElement(sWhere, oElement)在一个制定的位置插入一个元素
- Javascript支持在Firefox下读取XML节点的方法
- 对于firefox开发中在console显示信息的方法。
- dwzjs在firefox下遇到页面加载问题解决方法
- 对于firefox开发中在console显示信息的方法
- createElement方法在IE和Firefox下的差异
- javascript:window.close()在chrome,Firefox下失效问题解决方法
- 在openSUSE Linux下升级firefox的方法
- javascript:window.close()在chrome,Firefox下失效问题解决方法
- Jquery.post方法在firefox浏览器不调用问题处理
- innertext , insertadjacentelement , insertadjacenthtml
- insertAdjacentElement兼容处理
- Linux Shell 下的输出重定向
- 利用DYCOM快速建立wcf服务器端
- Android shell命令大全
- PHP获取传递进来的参数
- COM 组件内存分配和共享应用
- insertAdjacentElement方法在firefox中报错
- div+css+javascript图片切换(淡入浅出效果)
- CentOS更改时区
- java 双重检查锁定及单例模式
- Paxos算法1-算法形成理论
- php0跟false使用==有时相等必须用===
- SQL优化一点心得
- 基于linked server的scorm课件播放器数据同步从sqlserver->oracle
- firefox报错String contains an invalid character