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

看一下这段代码,咋输不出东西啊
<html>
<head>
<title>Writing to Same Doc</title>
<script language="JavaScript">
  function reWrite(){
    var newContent = "<html><head><title>A New Doc</title></head><body bgcolor='aqua'><h1>This   document is brand new.</h1>Click the Back button to see original document.</body></html>";
    document.write(newContent);
    document.close();
  }
</script>
</head>
<body>
  <form>
    <input type="button" value="Replace Content" onClick="reWrite()"/>
  </form>
</body>
</html>
------解决方案--------------------


可以输出结果啊
------解决方案--------------------
var newContent = "<html><head><title>A New Doc</title></head><body bgcolor='aqua'>"+
"<h1>This   document is brand new.</h1>"+
"Click the Back button to see original document.</body>"+
"</html>";