<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
<!-- begin
// please help yourself to this code.
var startTime =null;
var timerID =null;
var initial =new Date();
var pos =0;
var menuItem =null;  function initArray() {
this.length = initArray.arguments.length
for (var i = 0; i < this.length; i++) {
this[i+1] = initArray.arguments[i]
}
}  function parsemenuItem(data,num) {
for(var i=0;i<data.length;i++) {
if(data.substring(i,i+1)=="|") break;
}
if (num==0) return(data.substring(0,i));
else return(data.substring(i+1,data.length));
}  function startTimer() {
initial = new Date();
startTime=initial.getTime();
stopTimer();
menuItem = new initArray("赛迪网Windows世界|http://www.ccidnet.com/school/system/",
"赛迪网冲浪指南针|http://www.ccidnet.com/school/net/",
"赛迪网软件下载园|http://www.ccidnet.com/school/soft/",
"赛迪网办公自动化|http://www.ccidnet.com/school/office/",
"赛迪网软件e学堂|http://www.ccidnet.com/school/software/",
"赛迪网多媒体之家|http://www.ccidnet.com/school/multimedia/",
"赛迪网培训与考试|http://www.ccidnet.com/school/exam/",
"赛迪网电脑大词典|http://www.ccidnet.com/school/dict/"
);
showTimer();
}  function stopTimer() {
timerID=null;
menuItem=null;
//clearTimeout(timerID);
}  function showTimer() {
pos= (pos == menuItem.length) ? 1 : pos + 1;
document.forms[0].elements[0].
value=parsemenuItem(menuItem[pos],0);  timerID=window.setTimeout('showTimer()',4000);
}  function goToUrl() {
//parent.welcome.location=parsemenuItem(menuItem[pos],1);
this.location=parsemenuItem(menuItem[pos],1);
return (false);
}
// end -->
</SCRIPT></head>
<body bgcolor="#ffffff" onLoad="window.startTimer()">
<FORM>
<INPUT TYPE="button" VALUE=" zhouqing " NAME="goTo"
onClick="window.goToUrl()">
</FORM>
</body>
</html>
程序运行后,提示“对象不支持这个属性或方法”,怎么回事,有哪个人知道,谢谢

解决方案 »

  1.   

    存在一大堆问题。。主要是参数间的逗号全都是全角逗号!
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <SCRIPT LANGUAGE="JavaScript">
    <!--begin
    // please help yourself to this code.
    var startTime = null;
    var timerID = null;
    var initial = new Date();
    var pos = 0;
    var menuItem = null;function initArray() {
        this.length = initArray.arguments.length
        for (var i = 0; i < this.length; i++) {
            this[i + 1] = initArray.arguments[i]
        }
    }function parsemenuItem(data, num) {
        for (var i = 0; i < data.length; i++) {
            if (data.substring(i, i + 1) == "|") break;
        }
        if (num == 0) return (data.substring(0, i));
        else return (data.substring(i + 1,data.length));
    }function startTimer() {
        initial = new Date();
        startTime = initial.getTime();
        stopTimer();
        menuItem = new initArray("赛迪网Windows世界|http://www.ccidnet.com/school/system/", "赛迪网冲浪指南针|http://www.ccidnet.com/school/net/", "赛迪网软件下载园|http://www.ccidnet.com/school/soft/","赛迪网办公自动化|http://www.ccidnet.com/school/office/", "赛迪网软件e学堂|http://www.ccidnet.com/school/software/", "赛迪网多媒体之家|http://www.ccidnet.com/school/multimedia/", "赛迪网培训与考试|http://www.ccidnet.com/school/exam/", "赛迪网电脑大词典|http://www.ccidnet.com/school/dict/");
        showTimer();
    }
    function stopTimer() {
        timerID = null;
        menuItem = null;
        //clearTimeout(timerID);
    }
    function showTimer() {
        pos = (pos == menuItem.length) ? 1 : pos + 1;
        document.forms[0].elements[0].value = parsemenuItem(menuItem[pos], 0);    timerID = window.setTimeout('showTimer()',4000);
    }
    function goToUrl() {
        //parent.welcome.location=parsemenuItem(menuItem[pos],1);
        this.location = parsemenuItem(menuItem[pos],1);
        return (false);
    }
    // end -->
    </SCRIPT></head>
    <body bgcolor="#ffffff" onLoad="window.startTimer()">
    <FORM>
    <INPUT TYPE="button" VALUE=" zhouqing " NAME="goTo" onClick="window.goToUrl()">
    </FORM>
    </body>
    </html>