我的目的仅仅是为了跟ie的脚本兼容,但是现在还有问题,
1.我仍然不知道是否正确访问了div对象,我在脚本中设置它的innerText,但是没有反应,NS中对应innerText的属性或方法是什么?
2.我在window.onload事件中触发的,但NS好像也没反应,请问NS中对应IE的window.onload事件是什么?
3.如果能有关于NS内置对象的文档,就不会有这些问题了,哪里有NS的文档(NS的help中好像没有)?

解决方案 »

  1.   

    ns6+可以
    document.getElementById("DivID").innerText
      

  2.   

    http://www.csdn.net/Develop/Read_Article.asp?Id=5361Netscape 6 支持的对象和属性列表
      

  3.   

    下面的时钟在ie中正常,为什么在NS中没有结果?
    function window.onload() {
    clock();
    }
    function clock() {
    var today = new Date();
    document.getElementById("clk").innerText = today.toLocaleString();
    window.setTimeout("clock()", 1000);
    }
      

  4.   

    谁知道div对象的innerText属性在Netscape中对应的是什么啊?
      

  5.   

    NS没有innerText属性,只有innerHTML属性!
      

  6.   

    if(is.ns){
    HTMLElement.prototype.__defineSetter__("innerText",function(s){ this.innerHTML=s.replace(/\&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");});
    HTMLElement.prototype.__defineGetter__("innerText",function(){var r=this.ownerDocument.createRange();r.selectNodeContents(this);return r.toString()});
    }
    这样就可以凑合用 innerText 了