javascript 1、新窗口打開時彈出確認框,是否打開 提示: 使用 if 判斷確認框是否點擊了確定,如點擊彈出輸入對話框,否則沒有任何操作。 2、通過輸入對話框,確定打開的網(wǎng)址,默認為 http://idcbgp.cn/ 3、打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
function?openWindow(){ ????????var?put?=?"確認"; ????????alert(put); ????????if ???? ????????window.open('http://idcbgp.cn','_blank','width=400,height=500,menubar=no,toolbar=no,?status=no,scrollbars=yes') ???????? ????????}
2017-08-16
function openWindow(){
? ? var mymessage=confirm("確認進如網(wǎng)站嗎") ? ? ? ? ;
? ? if(mymessage==true)
? ? {
? ? ? var message=prompt("請輸入網(wǎng)址");
? ? ? if(message!=null)
? ? ? {
? ? ? ??
? ? ? ? ? window.open(message,"新窗口","width=400,height=200,top=100,menubar=no,toolbar=no");
? ? ? }
? ? ? else
? ? ? {
? ? ? ? ? window.open("http://idcbgp.cn/","新窗口","width=400,height=200,top=100,menubar=no,toolbar=no");
? ? ? }
? ? }
? ? else
? ? {
? ? ? mymessage=null;
? ? }
? ??
? } ? ?
2016-09-16
? ? ?function wopen(){
? ? ? ? ? var window.open=confirm(是否打開)
? ? if (window.open==true)
? ? { document write('http://idcbgp.cn','_blank','width=400,height=500,menubar=no,toolbar=no')}
? ? else {
? ? ? ? window.close
? ? }
}
2016-09-07
function openWindow(){
????if(confirm("是否打開新窗口")){
??????? var myUrl=prompt("請輸入網(wǎng)址","http://idcbgp.cn");
????????window.open(myUrl,"_blank","width=400,height=500,menubar=no,toolbar=no") ;
????}
}
用if判斷是否打開新窗口
window.open里面的url從prompt里面獲取
2016-09-07
if(put==true)
2016-09-07
2016-09-07
var openw=confirm("是否在新窗口打開網(wǎng)站?");//將confirm語句賦值給一個變量
?if(openw==true)//判斷是否點擊確定
? ? {
? ? ? var webadress=prompt("請輸入網(wǎng)址","http://idcbgp.cn/");
? ? // 通過輸入對話框,確定打開的網(wǎng)址,默認為 http://idcbgp.cn/
? ?if(webadress!=null)//輸入對話框確定打開網(wǎng)址
? {?
? ? ? window.open(webadress,"_blank",'width=400,height=500,menubar=no,toolbar=no');
? }
?