Javascript 清除IE10中的innerHTML故障

Javascript 清除IE10中的innerHTML故障,javascript,internet-explorer-10,Javascript,Internet Explorer 10,以下是我的功能: swPageProt.showContent = function () { if (this._Parent) { var container = this._Parent.getContentNode(); if (container) { console.log(this._Content.innerHTML); console.log(

以下是我的功能:

    swPageProt.showContent = function () {
        if (this._Parent) {
            var container = this._Parent.getContentNode();
            if (container) {
                console.log(this._Content.innerHTML);
                console.log(this._Parent.getContentNode().innerHTML);
                container.innerHTML = '';
                if (this._Content instanceof WT.BaseControl) {
                    this._Content.addToNode(container);
                }
                else if (this._Content.tagName) {
                    console.log(this._Content.innerHTML);
                    console.log(this._Parent.getContentNode().innerHTML);
                    container.appendChild(this._Content);
                }
                else {
                    container.innerHTML = this._Content + '' || '';
                }
            }
        }
    };
我想清除父容器并将
此内容附加到它。这在Chrome和Firefox中运行良好,但行
container.innerHTML=''
清除IE10中的父实例和
实例。我总是得到空的父容器和空的子容器(
this
)内容。如何在IE10中修复它?

找到解决方案!
有必要使用
container.removeChild(container.firstChild)而不是
container.innerHTML=''

什么是
swPageProt
?什么是
swPageProt.\u parent
?相关的DOM看起来像什么?如果
this.\u Content+'
的计算结果为false,那么该值与
'
有何不同?@RobG,此
swPageProt
是用户定义的对象。它表示页面堆栈中的页面。它具有表示HTML div元素的
\u Content
属性。它还具有表示整个堆栈容器的
\u Parent
属性。因此
this.\u Parent.getContentNode()
返回完整堆栈容器div元素,该元素也包括
this.\u Content
作为第一个子元素。