怎么彈出輸入對話框?
function openWindow()
? {
? ? var open=confirm("是否打開?");
? ? ?{
? ? ? ? ?if(open=true)
? ? ? ? ?{
? ? ? ? ? ?var url=prompt("確定打開嗎?","http://www.xianlaiwan.cn");
? ? ? ? ? ?if(url!=null)
? ? ? ? ? ?{
? ? ? ? ? ? ? ?window.open('http://www.xianlaiwan.cn','_blank','width=400,hight=500,menubar=0,toolbar=0');
? ? ? ? ? ?}
? ? ? ? ? ?else{alert("取消了");}
? ? ? ? ?}
? ? ? ? ?else{ alert("取消了")}
? ? ?}
? ? }
? ? ? ?
2016-07-07
function openWindow(){
? ? var msg=confirm("是否打開新窗口?");
? ? if(msg=true)
? ? ? ? {
? ? ? ? ? ? var score=prompt("請輸入網址","http://www.xianlaiwan.cn");
? ? ? ? ? ? if(score!=null && score!=""){
? ? ? ? ? ? window.open('http://www.xianlaiwan.cn','_blank','width=400px,height=500,menubar=no,toolbar=no');
? ? ? ? ? ? }
? ? ? ? }
? ? else
? ? ? ? {
? ? ? ? ? ? return false
? ? ? ? ? ? }
? ? }?
2016-07-07
2016-07-07
取消倒數第二個else。你可以看看w3school的promt()