<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>標(biāo)題頁</title>
</head>
<body>
<SCRIPT LANGUAGE="JavaScript">
function makeArray(q){
for(i=1 ; i < q ; i++){this[i]=0}} //設(shè)置從1開始的數(shù)組
w=1;
howmanysites=4; // 顯示導(dǎo)航的內(nèi)容個數(shù)
Sites = new makeArray(howmanysites);//設(shè)置導(dǎo)航數(shù)組
Sites[1] = "http://www.google.com|全球的搜索引擎!"; //以“|”間隔站點和描述
Sites[2] = "http://www.baidu.com|中國的搜索引擎!";
Sites[3] = "http://www.yahoo.com|還有一個搜索引擎!";
function showSites() {
if (w > howmanysites) { w=1; }; //如果導(dǎo)航到結(jié)尾,則從頭開始
var string=Sites[w] + "";
var split=string.indexOf("|"); //通過間隔符分組
var url=string.substring(0,split);
var word=string.substring(split + 1,string.length);//獲取鏈接的描述
document.form.url.value=url; //獲取鏈接的Url地址
document.form.word.value=word;
w+=1;
window.setTimeout('showSites()',5000); //每隔5秒鐘改變一下鏈接
}
function visitSite() {
window.location=document.form.url.value; //導(dǎo)航到指定位置
}
</SCRIPT>
<center>
<form name=form>
<table><tr><td align=center>
<input type=hidden name=url value="">
<input type=text name=word value="" onFocus="visitSite()" size=40>
</td></tr></table>
</form>
</center>
<script>
showSites();
</script>
</body>
</html>