日期:2014-05-16  浏览次数:20360 次

在FireFox里怎么能实现以下在IE能实现的功能?
以下请在IE下运行看看,如何能在Firefox也OK   ?

<!DOCTYPE   html   PUBLIC   "-//W3C//DTD   XHTML   1.0   Transitional//EN "   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html   xmlns= "http://www.w3.org/1999/xhtml ">
<head>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 "   />
<title> 无标题   1 </title>
<style   type= "text/css ">
body{font:   12px   Tahoma,   Verdana;padding:0px;}
#Composition{border:1px   #333   dotted;height:290px;width:390px;margin:0px;padding:3px;}
.texteditsize{border:1px   #000   solid;height:300px;width:400px;padding:3px;}
</style>
<script   type= "text/javascript "   language= "javascript ">
function   opentext()
{
    Composition.document.open();
    Composition.document.write( " <!DOCTYPE   html   PUBLIC   \ "-//W3C//DTD   XHTML   1.0   Transitional//EN\ "   \ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\ "> <html   xmlns=\ "http://www.w3.org/1999/xhtml\ "> <head> <meta   http-equiv=\ "Content-Type\ "   content=\ "text/html;   charset=gb2312\ "   /> <title> 新闻 </title> <style   type=\ "text/css\ "> body{font:   14px   Tahoma,   Verdana;} </style> </head> <body> 请在此编辑新闻内容... </body> </html> ");
    Composition.document.close();
    Composition.document.designMode= "On ";           //打开编辑模式
}
</script>

</head>
<body   onload= "opentext() ">
<div   class= "texteditsize "> <iframe   id= "Composition "   marginheight= "0 "   marginwidth= "0 "> </iframe> </div>
</body>
</html>

------解决方案--------------------
document.getElementById( "_iframe ").contentWindow;