<iframe id="HtmlEdit" name="HtmlEdit" marginWidth="0" marginHeight="0"  frameBorder="1" width="561" height="461" src="wqsytsph1.inc" ></iframe>wqsytsph1.inc里的内容是”1234556“
在JS中要怎么写才能得到?
还有,对iframe有如下代码: 
editor=document.getElementById("HtmlEdit").contentWindow;
      editor.document.designMode = "On";
      editor.document.contentEditable = true;
      editor.document.open();
      editor.document.writeln();‘为了兼容FF只能这样写,所以我想得到wqsytsph1.inc的内容写进去达到和IE一样的效果
      editor.document.close();
其实不加上面的代码是可以得到wqsytsph1.inc的内容的,加了ALERT就提示空白,请高手指点

解决方案 »

  1.   

    editor.document.writeln(); 这一句就把内容给清空了
      

  2.   

    editor.document.open(); 
    editor.document.writeln();‘为了兼容FF只能这样写,所以我想得到wqsytsph1.inc的内容写进去达到和IE一样的效果 
    editor.document.close(); 不太明白你的意思 把这3句删掉看看吧
      

  3.   

    因为FF和IE不一样,为兼容FF后三句是必须的,不写后三句可以得到内容,但在FF中就不能对IFRAME进行修改。我也知道editor.document.writeln()把内容清空了,但这三句肯定要,editor.document.writeln();的作用就是为了在FF中把SRC文件的内容输入到IFRAME中,比如如果我能获得内容SS,editor.document.writeln(ss)就能达到和IE一样的效果同时对IFRAME可以进行修改。其实IE没这么多问题,这不被兼容性搞的么,
      

  4.   

    没人来自己顶,其实就是一简单的HTML在线编辑程序,只不过要兼容IE和FF而已,大家做时都没碰到过吗?