我用本章节的内容写了一段代码,结果浏览器老是崩溃fierfox和chrome都出现这种问题
求教下大神这是什么原因啊?还有时间下方的效果也出不来
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>Examples</title> <meta name="description" content=""> <meta name="keywords" content=""> <link href="" rel="stylesheet"> </head> <script type='text/javascript'> function clock(){ var mytime=new Date(); var mydate=mytime.getFullYear()+'年'+mytime.getMonth()+'月'+mytime.getDate()+'日'; var m=mytime.getMinutes(); var h=mytime.getHours(); var s=mytime.getSeconds(); var t; m=startTime(m) s=startTime(s) document.getElementById("tm").innerHTML=mydate+h+':'+m+':'+s+'</br>'; t=setInterval('clock()',500) } function startTime(i){ if(i<10){ i="0"+i } return i } var user_hf=window.location.href; var user_na=navigator.userAgent; var user_sc_hg=screen.availHeight; var user_sc_wd=screen.availWidth; document.getElementById('us').innerHTML=user_hf+'</br>'+user_na+'</br>'+user_sc_hg+';'+user_sc_wd; </script> <body onload='clock()'> <b id='tm'></b> <span id='us'></span> </body> </html>