小問題--高分99,怎么才能正確的用全局變量﹖
我有一個js文件﹐(內容如下)我想實現3秒跳到slide0003.htm的頁面﹐4秒跳到slide004.htm的頁面﹐8秒跳到slide0004的頁面。因為我每個頁面都得引用js,
所以老是重復3﹑4﹑8秒的內容﹖﹖何解??
var $time = new Array(3,4,8);
var iSecond = 0,count=0;
var $index=new Array("02","03","04");
timer = setInterval("bao($time[count].toString(),$index[count].toString())",1000);
function bao(time,index)
{
iSecond++;
if(iSecond==time)
{
count++;
alert(count);
if (index!=null)
{
document.location="slide00"+index+".htm";//主要
}
}
}