在IE9上报错:对象不支持“createContextualFragment”属性或方法。

上一篇 / 下一篇  2013-11-14 11:00:42 / 个人分类:Error

在IE9上报错:对象不支持“createContextualFragment”属性或方法。
解决方法一:设置IE的兼容模式
解决方法二:在页面中增加下面脚本


<script type="text/javascript">
if ((typeof Range !== "undefined") && !Range.prototype.createContextualFragment)
{
    Range.prototype.createContextualFragment = function(html)
    {
        var frag = document.createDocumentFragment(), 
        div = document.createElement("div");
        frag.appendChild(div);
        div.outerHTML = html;
        return frag;
    };
}
</script>

方法二没有亲手实践,暂时没找到在IE上运行脚本的方法步骤,不过网友们都说可以。后续实践后将附上方法步骤


TAG:

 

评分:0

我来说两句

我的栏目

日历

« 2024-05-16  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 17475
  • 日志数: 7
  • 建立时间: 2013-08-30
  • 更新时间: 2014-01-16

RSS订阅

Open Toolbar