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

write()和writeln()的区别,为什么在浏览器中显示一样
write()和writeln()的区别是什么?
writeln()为什么不换行
write()

------解决方案--------------------
document.writeln("just");
document.write("a");
document.write("test");
貌似只插入了一个空格的样子
------解决方案--------------------
document.writeln("aaa");
等于
document.write("aaa"+"\n");
------解决方案--------------------
html是忽略换行符(\n)的,除非是在<pre></pre>中
<pre>
<script type="text/javascript">
document.writeln("A");
document.write("B");
document.write("C");
</script>
</pre>