为什么这样写就能输出
function reWrite(){
// assemble content for new window
var newContent = "<html><head><title>A New Doc</title></head>"
newContent += "<body bgcolor='aqua'><h1>This document is brand new.</h1>"
newContent += "Click the Back button to see original document."
newContent += "</body></html>"
// write HTML to new window document
document.write(newContent)
document.close() // close layout stream
}
function reWrite(){
// assemble content for new window
var newContent = "<html><head><title>A New Doc</title></head>"
newContent += "<body bgcolor='aqua'><h1>This document is brand new.</h1>"
newContent += "Click the Back button to see original document."
newContent += "</body></html>"
// write HTML to new window document
document.write(newContent)
document.close() // close layout stream
}
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>";这样不换行是可以的 如想换行需要连接符
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>";
"<h1>This document is brand new.</h1>"+
"Click the Back button to see original document.</body>"+
"</html>";