腳本說明:第一步:把如下代碼加入區域中<br/><!-- Hide Script from Old Browsers<br/>Keyword = new Object();<br/>Descrip = new Object ();<br/>Address = new Object();<p><br/><p>// Keyword[0] = n (where n is the number of keywords which can be searched<br/>Keyword[0] = 5 //查詢組的數量對應組;<p>Keyword[1] = "javascript"<br/>Descrip[1] = "最完整的javascript資源站-javascript2000.com"<br/>Address[1] = "http://www.javascript2000.com"<p>Keyword[word 2] = "javascript"<br/>Descrip[2] = "很好的javascript網站"<br/>Address[2] = "http://www.cnlot.com/"<p>Keyword[3] = "javascript"<br/>Descrip[ 3] = "java神捕"<br/>Address[3] = "http://pcafei.3322.net/"<p>Keyword[4] = "javascript"<br/>Descrip[4] = "精彩天地"<br/>Address[4 ] = "http://demoy.3322.net/"<p>Keyword[5] = "javascript"<br/>Descrip[5] = "國外最大的javascript資源站"<br/>Address[5] = "http://www .javascript.com/"<br/>function checkDatabase() {<p>var Found = false<br/>var Item = document.forms[0].searchfor.value.toLowerCase();<p>stats='toolbar=nos='toolbar=no,lono, directories=no,status=no,menubar=no,' <br/>stats += 'scrollbars=yes,resizable=yes' <br/>MsgBox = window.open ("","msgWindow",stats) <br/>MBox.documentwrite(doct." <head><title>查詢結果");<br/>MsgBox.document.write ("<BODY BGCOLOR=#ffffff TEXT=#0000000 LINK=#000080 VLINK=#800040 <br/>A0K=#FF ><CENTER>查詢結果") <br/>MsgBox.document.write ("For the keyword: "+Item+"<HR>");<br/>for (var i=1; i <= Keyword[0]; i++) {<br/>if(Item == Keyword[i]) {<br/>Found = true;<br/>MsgBox.document.write (Descrip[i]+"<BR><A HREF="http://www.php1.cn /"><p>}<br/>}<br/>if(!Found)<br/>MsgBox.document.write ("沒有發現與該關鍵字有關的條目。 ") <br/>MsgBox.document.write ("<H6>Enjoy it!<BR><A HREF="http://www.php1.cn/">MsgBox.document.write ("<FORM class='pt9' ><CENTER>") <br/>MsgBox.document.write ("<INPUT type='button' value='關閉查詢視窗' onClick = 'self.close()'>") <br/>MsgBox.document.write ("</ CENTER>") }<br/>// --><br/>如下程式碼產生查詢表單介面: 請輸入關鍵字: 輸入小寫字元 以上是站內搜尋腳本範例五(javascript)_Javascript教學的內容,更多相關內容請關注PHP中文網(www.php.cn)!