我哪里出錯了
function openWindow()
{var mymessage=confirm("是否打開?");
if (mymessage==true)
{var b=prompt("請輸入網(wǎng)址","http://idcbgp.cn")
if (b!=null)
{window.open("http://idcbgp.cn","_blank","width=400,height=500,menubar=no,toolbar=no");
}
else
{alert("game over"); ??
}
}
else
{alert("game over");};
}
2016-07-28
你的if(b!=null)的左括號用的中文,改成英文就好了。
2016-07-28
function openWindow(){
??????? var mychar=confirm("是否打開?");
??????? if(mychar==true){
??????????? var mychar1=prompt("請輸入要打開的網(wǎng)址?");
??????????? if(mychar1!=null){
??????????????? window.open(mychar1,'width=800,height=1000');
??????????? }
??????? }
??????? }??
我調試了一下,你那個還有錯,現(xiàn)在這個沒問題
2016-07-28
function openWindow()
{var mymessage=confirm("是否打開?");
if (mymessage==true)
{var b=prompt("請輸入網(wǎng)址");
if (b!=null)
{window.open(b,"_blank","width=400,height=500,menubar=no,toolbar=no");
}
else
{alert("game over"); ??
}
}
else
{alert("game over");}
}
應該是這樣的,你里面標點符號加的還有問題
2016-07-28
var b=prompt("請輸入網(wǎng)址","http://idcbgp.cn")結尾處加分號
alert操作去掉,題目要求是否則無操作