我在JS中瞎写了一个小东西,本意是让它自己变更外观的,但很诡异只出来个数字,但更诡异的是查看源文件竟然什么标头也没有,也只有一个数字...
Code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
#a{ width:300px; height:50px; background:#666600; border:1px red solid;}
</style>
<script language="javascript">
var tem="";
function fun()
{
if(document.getElementById("a").style.backgroundColor=="#666600")
{
document.getElementById("a").style.backgroundColor="#663300";
}
else
{
document.getElementById("a").style.backgroundColor="#666600"
}
var cnum=Math.ceil(Math.random()*100);
document.write(cnum);
}
function fun1()
{
tem=setInterval("fun()",100);
}
</script>
</head>
<body>
<div id="a"></div>
<input type="button" value="Click" onclick="fun1()" />
</body>
</html>