正確的答案
function openWindow(){ ? ?var message=confirm("是否打開?"); ? ? ? if(message==true){ ? ? ? ? ? ?var openweb=prompt("請輸入要打開的網址:","http://www.xianlaiwan.cn/"); ? ? ? ? ? ? if(openweb!=null){ ? ? ? ? ? ? ? window.open("opeaweb","_blank","width:400,height=500,menubar=no;toolbar=no"); } ? ? ? ? ? ?} ? ?}
2015-11-28
??<script?type="text/javascript">?? ????function?openWindow(){ ????????if(!confirm("是否在新窗口中打開?")){ ????????????return; ????????} ????????var?proval?=?prompt("輸入打開的網址:","http://www.xianlaiwan.cn/"); ????????if(proval){ ????????????window.open(proval,"_blank","width=400px,height=500px,menubar=no,toolbar=no,scrollbars=yes"); ????????}else{ ????????????return; ????????} ????????} ??</script>這個OK
2015-11-20
為什么我像你這么寫點擊沒用?
2015-11-19
? function openWindow(){
? ? ? ? var message=confirm("是否打開?"); // 新窗口打開時彈出確認框,是否打開
? ? ? ? ? ?if(message==true){ ? // 通過輸入對話框,確定打開的網址,默認為 http://www.xianlaiwan.cn/
? ? ? ? ? ? ? ?var openweb=prompt("請輸入要打開的網址:","http://www.xianlaiwan.cn/");
? ? ? ? ? ? ? ? ? ?if(openweb!=null){
? ? ? ? ? ? ? ? ? ? ? window.open("opeaweb","_blank","width:400,height=500,menubar=no;toolbar=no"); //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。 ?}
? ? ? ? ? ? }
? ? }
? ? ? ??