报错:

 

错误: 对象不支持“createContextualFragment”属性或方法

 

 

解决办法:在页面执行时加入如下代码

 

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;
            };
        }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-04-21
  • 2021-12-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-31
  • 2021-05-30
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案