prompt還是有問題
function openWindow(){ ? ?var open1=confirm("是否跳轉到新窗口?"); ? ?if(open1==true){ ? ?prompt("請輸入URL","http://www.xianlaiwan.cn"); ? ? ? ?window.open("http://www.xianlaiwan.cn","_blank","width:400px height:500px menubar=no toolbar=no"); } ? ?else{return null;} ? ?} ? ?為什么prompt還是有問題
2016-04-26
定義個變量,把prompt賦給它,window.open(變量,參數......)。變量都不懂雙引號的
2016-04-07
你這里的?prompt("請輸入URL","http://www.xianlaiwan.cn"); ? 沒有用!??!不管你在輸入框中輸入什么值,打開的都是http://www.xianlaiwan.cn。
因為決定跳轉到那個頁面的是window.open("myUrl","_blank","width:400px height:500px menubar=no toolbar=no"); 這個語句,而不是prompt("請輸入URL","http://www.xianlaiwan.cn");?
如果你想跳轉到你輸入的網址,請按照下面的來做。
我沒有試過,但是理論上可行?。。?/p>
var myUrl=?prompt("請輸入URL","http://www.xianlaiwan.cn");
window.open("myUrl","_blank","width:400px height:500px menubar=no toolbar=no");?
不行的話,你把window.open("myUrl","_blank","width:400px height:500px menubar=no toolbar=no");?
改為window.open(myUrl,"_blank","width:400px height:500px menubar=no toolbar=no");?
即吧引號去了,試一試?。?!
2016-04-06
http://www.xianlaiwan.cn/
2016-04-06
重新輸入下網址