新手javascript简单问题,麻烦进来看下
下面代码原书照抄,运行起来没有状态栏没一点反应,怎么回事,我的是IE6
<html>
<head>
<script language= "JavaScript ">
<!-- Hide
var scrtxt= "怎麽样 ! 很酷吧 ! 您也可以试试. "+ "Here goes your message the visitors
to your page will "+
"look at for hours in pure fascination... ";
var lentxt=scrtxt.length;
var width=100;
var pos=1-width;
function scroll() {
pos++;
var scroller= " ";
if (pos==lentxt) {
pos=1-width;
}
if (pos <0) {
for (var i=1; i <=Math.abs(pos); i++) {
scroller=scroller+ " ";}
scroller=scroller+scrtxt.substring(0,width-i+1);
}
else {
scroller=scroller+scrtxt.substring(pos,width+pos);
}
window.status = scroller;
setTimeout( "scroll() ",150);
}
//-->
</script>
</head>
<body onLoad= "scroll();return true; ">
这里可显示您的网页 !
</body>
</html>
------解决方案--------------------注意过行
var scrtxt= "怎麽样 ! 很酷吧 ! 您也可以试试. "
+ "Here goes your message the visitors to your page will "
+ "look at for hours in pure fascination... ";