231、随意选择要去的地方

231、随意选择要去的地方

以下代码加入<head>区域

以下代码加入<body>区域

<SCRIPT LANGUAGE="JavaScript">

 

 

 

function makeArray(q){

 

for(i=1 ; i < q ; i++){this[i]=0}}

 

w=1;

 

howmanysites=4; // How many sites are listed below?

 

 

 

Sites = new makeArray(howmanysites);

 

 

 

 

 

Sites[1] = "../../../../www.163.com~网易_7c国内最大的综合性站点!/default.htm";

 

Sites[2] = "../../../../www.sohu.com~搜狐_7c国内最大的搜索引擎!/default.htm";

 

Sites[3] = "../../../../www.yahoo.com~雅虎_7c全球最有影响的站点之一/default.htm";

 

Sites[4] = "http://www.7stk.com/~新浪网_7c国内最大的新闻站点/default.htm";

 

 

 

function showSites() {

 

if (w > howmanysites) { w=1; };

 

var string=Sites[w] + "";

 

var split1=string.indexOf("~");

 

var split2=string.indexOf("|");

 

var url=string.substring(0,split1);

 

var name=string.substring(split1 + 1,split2);

 

var word=string.substring(split2 + 1,string.length);

 

document.form.url.value=url;

 

document.form.name.value=name;

 

document.form.word.value=word;

 

w+=1;

 

window.setTimeout('showSites()',3000);

 

 

 

// You can change the speed!  3000 = 3 sec delay.  5000 = 5 sec delay, etc.

 

 

 

}

 

function visitSite() {

 

window.location=document.form.url.value;

 

}

 

</SCRIPT>

 

<form name=form>

 

<table><tr><td align=center>

 

<input type=button name=name value="Visit" onClick="visitSite()" size=25>

 

<input type=hidden name=url value="">

 

<input type=text name=word value="" size=40>

 

</td></tr></table>

 

</form>

 

</center>

 

 

 

<script>

 

showSites();

 

</script>

 

 

Write a comment

Comments: 0