我的答案喲
function openWindow() ? ?{ var url="http://idcbgp.cn"; ? ? ?var message=confirm("要打開嗎"); ? ? ? ?if(message==true) ? ? ? ?{ ?var text=prompt("請輸入網(wǎng)址",url); ? ? ? ? ? window.open(text,'_blank','width=400,height=500,menubar=no,toolbar=no'); ? ? ? ?} }
2016-01-18
???
2016-01-18
?function openWindow()
??????? {
??????????? var openweb=confirm("是否打開新窗口");
??????????? if(openweb==true)
??????????? // 新窗口打開時彈出確認(rèn)框,是否打開
??????????? {
??????????????? var webadress=prompt("請輸入打開網(wǎng)址","http://idcbgp.cn")
??????????????? if(webadress!=null)
??????????????? {
??????????????????? window.open(webadress,"_blank","width=400px,height=500px,mennbar=no,toolbar=no")
??????????????? }
??????????? else{
??????????????? alert("走了啊")
??????????? }
??????? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
?????????? ?
??????? }
??????? else{alert("真的離開了")}
??????? }