HTML的注释在不兼容浏览器中隐藏JavaScript代码问题[高手请进]
写了如下一段简单的代码
<SCRIPT>
<!--document.writeln( "This line was created with embedded JavaScript code. ");
document.writeln( "This line was also create with embedded JavaScript code. ");-->
</SCRIPT>
采用了 <!-- --> html注释,按照书上的解释注释中的javascript代码应该可以正常执行,但是我在浏览器中调试却没有打印出结果,去掉注释则正常打印,请问为什么?谢谢!!!
[解决办法]
换行即可
<SCRIPT>
<!--
document.writeln( "This line was created with embedded JavaScript code. ");
document.writeln( "This line was also create with embedded JavaScript code. ");
-->
</SCRIPT>