多種取消打開(kāi)新窗口的方法
var myurl=confirm('是否打開(kāi)新的網(wǎng)址?'); ? ? ? ?if (myurl) { ? ? ? ? ? ?promp = prompt("請(qǐng)輸入你的網(wǎng)站:",'http://idcbgp.cn/'); ? ? ? ? ? ?if (promp != "" && promp !=null) { ? ? ? ? ? ? ? ?window.open(promp, '_blank', 'width=400,height=500,menubar=no,toolbar=no'); 這個(gè)才是對(duì)的 他們的取消全部跳轉(zhuǎn)null了
2017-05-02
function openWindow(){
? ? ? ? var mymessage=confirm("新窗口是否打開(kāi)?");// 新窗口打開(kāi)時(shí)彈出確認(rèn)框,是否打開(kāi)
? ? ? ??
? ? ? ? if(mymessage==true)
? ? ? ? {
? ? ? ? ? ? var myname=prompt("請(qǐng)輸入網(wǎng)址:","http://idcbgp.cn");// 通過(guò)輸入對(duì)話框,確定打開(kāi)的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
? ? ? ? ? ? if(myname!=null)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? window.open("http://idcbgp.cn","_blank",'width=400,height=500,menubar=no,toolbar=no' );//打開(kāi)的窗口要求,寬400像素,高500像素,無(wú)菜單欄、無(wú)工具欄。
? ? ? ? ? ? ? ? }
? ? ? ? }
? ? ? ? else{
? ? ? ? ? ? document.write("新窗口未打開(kāi)");
? ? ? ? }
? ??
? ? } ?