練習(xí)題正解
function openWindow(){ ? ?if(confirm("確定打開新窗口嗎?")==true){ ? ?var url = prompt("請輸入一個網(wǎng)址","http://idcbgp.cn/"); ? ? ?}else{ ? ? ? ? ? ?} ? ?if(url==true){ ? ?window.open( url,"_blank","toolbar=no, menubar=no, scrollbars=yes, ?width=400, height=400"); }else{ ? ? } ? ?}
2016-10-28
? ? function openWindow()
? ? {
? ? ? ? var mymessage = confirm("Are you sure to open a new window?");
? ? // 新窗口打開時彈出確認框,是否打開
? ? if(mymessage == true)
? ? {
? ? ? ? var network = prompt("Please enter URL!","http://idcbgp.cn/");
? ? // 通過輸入對話框,確定打開的網(wǎng)址,默認為 http://idcbgp.cn/
? ? ? ? window.open(network,'_blank','width=400px,height=500px');
? ? }
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
}
2016-10-28
^_^