為什么總不對呢?
function openwindow()
{
?var queren=confirm("是否打開新窗口?");
? ? ?if(queren==true)
? ? ? ? {var duihua=prompt("請輸入網(wǎng)址","http://idcbgp.cn/”);
? ? ? ? ?if(duihua!=null)
? ? ? ? ? ?{window.open("http://idcbgp.cn/”,"_blank","width=400px","high=500px","menubar=no","toolbar=no");}
? ? ? ? ?else {}
? ? ? ? ?}
? ? else{}
}?
2017-04-12
第一個,代碼里面包含大量的中文符號
第二個,你自己定義的函數(shù)名有沒有被調(diào)用
2017-04-16
是符號不能用中文的
你定義的duihua變量只是用來做的判斷 ,你這樣寫 無論別人輸入的網(wǎng)站什么 都會跳轉到http://idcbgp.cn,最好達到別人輸入什么網(wǎng)址,就跳轉到什么網(wǎng)址? ,別人如果輸入網(wǎng)址,網(wǎng)址將會被傳入你定義的變量duihua中,所以你后面可以這樣寫window.open(duihua,"_blank","width=400px","high=500px","menubar=no","toolbar=no") ?