下面一段代码,我分别测试时好像没事,但一嵌入if……else 语句,就好像两个分支都没有执行,请问这是怎么回事?
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>无标题文档</title> </head>
<body> <center> <font face="隶书" color="#990000" size="6">welcome to come here</font></center> <script language="javascript"> if(navigator.appName=="Netscape") document.write.('<hr width=2 color=red>'); document.write.("aaa"); else{ document.write("<font face='隶书' color=darkgreen size=4>"); document.write("<marquee border='0'>hello!welcome to my homepage.</marquee></font>");} document.write("<br><font size=4 color=blue>the browser you use is:<br>"); document.write(navigator.userAgent); document.write(navigator.appName); document.write("</font>");
</script> </body> </html>