- 爱易网页
-
JavaSript
- 大家帮小弟我看看为什么这段代码在firefox下不能运行?
日期:2014-05-16 浏览次数:20385 次
大家帮我看看为什么这段代码在firefox下不能运行??
<html xmlns= "http://www.w3.org/1999/xhtml ">
<head>
<meta name= "generator " content=
"HTML Tidy for Windows (vers 13 May 2007), see www.w3.org " />
<meta http-equiv= "Content-Type " content=
"text/html; charset=us-ascii " />
<title> title </title>
<script language= "javascript " type= "text/javascript ">
function Bold()
{
window.frames[ 'edit '].document .selection.createRange().execCommand( "Bold ",false,null);
}
function TOHTML()
{
window.document.getElementById( 'preview ').innerText =window.frames[ 'edit '].document.body.innerHTML;
}
function FromHTML()
{
if (window.document.getElementById( 'preview ').innerText != ' ')
{
window.frames[ 'edit '].document.body .innerText = ' ';
window.frames[ 'edit '].document.write(window.document.getElementById( 'preview ').innerText);
}
}
</script>
</head>
<body>
<form>
<iframe src= " " name= "edit " id= "edit " frameborder= "1 " width=
"495 " height= "295 " marginWidth= "0 " marginHeight= "0 "> </iframe>
<textarea src= " " name= "preview " id= "preview " width= "800 "
height= "400 " rows= "7 " cols= "69 ">
</textarea> <script language= "javascript " type= "text/javascript ">
window.frames[ "edit "].document.designMode= "On ";
window.frames[ "edit "].document.contentEditable = true;
</script>
<button onclick= "Bold(); "> Bold </button>
<button onclick= "TOHTML(); "> Page To HTML </button>
<button onclick= "FromHTML(); "> HTML To Page </button>
</form>
</body>
</html>
=====================================================================
是一个编辑器,在IE下可以运行,但是在Firefox下运行总是有问题,不知道是怎么回事?
哪位高手帮忙看一下?谢谢.
js中构造函数的prototype属性的引用有关问题