精華區beta Web_Design 關於我們 聯絡資訊
我想請教一下,我要寫一個程式在網頁上 把密碼打進去後,會連到相對的資料夾上 例如:密碼aaaa,執行後,會跳到 http://xxx.com.tw/aaaa ^^^^ 密碼名稱 <script language="JavaScript"> <!-- function passWord() { var testV = 1; var pass1 = prompt('請輸入密碼!',' '); while (testV < 3) { if (!pass1) history.go(-1); if (pass1.toLowerCase() == "aaa") { alert('密碼正確!歡迎光臨'); window.open('http://xxx.com.tw/*[1;31m密碼/'); break; } testV+=1; var pass1 = prompt('密碼錯誤!!.','Password'); } if (pass1.toLowerCase()!="password" & testV ==3) history.go(-1); return " "; } --> </script> <center> <form> <input type="button" value="會員入口" onClick="passWord()"> </form> </center> window.open('http://xxx.com.tw/密碼/'); ^^^^ 密碼那要怎麼寫才會變成我輸入的資料啊?? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 211.23.208.78
PsMonkey:先作字串相加,然後再丟進 open() 02/17 15:42
ilovewe:字串相加??怎麼加啊~~ 02/17 15:46
abgne:window.open('http://xxx.com.tw/'+pass1); 02/17 15:54
ilovewe:解決了~~~謝謝大家 ^^Y 02/17 16:01
PsMonkey:你寫的是 JavaScript,絕對不是 JAVA!!!! 02/17 16:17
ilovewe:嗯嗯~~我知道我寫的是JavaScript 02/17 16:42