是否打開網(wǎng)頁(yè),點(diǎn)擊取消時(shí),彈出了輸入網(wǎng)址的對(duì)話框
? function openWindow(){
? ? ? ?var mycon = confirm("是否打開?");
? ? ? ?var mypro = prompt("確定要打開的網(wǎng)址","http://idcbgp.cn");
? ? ? ??
? ? ? ?if(mycon == true)
? ? ? ?{
? ? ? ? ? ?
? ? ? ? ? ? if(mypro != null)
? ? ? ? ? ? ?window.open(mypro,'_blank','width=400,height=500,toolbar=no,menubar=no')
? ? ? ? ? ? else
? ? ? ? ? ? ? alert("再見!");
? ? ? ?}
? ? ? ?else
? ? ? ?
? ? ? ? ?alert("結(jié)束!");
? ? ? ??
? ? }
2016-09-22
var mycon = confirm("是否打開?");
? ? ? ?if(mycon == true)
? ? ? ?{
? ? ? ? ? ?var mypro = prompt("確定要打開的網(wǎng)址","http://idcbgp.cn");? ?// 這里是彈出輸入框的位置,按照邏輯,彈框應(yīng)該是在點(diǎn)擊確認(rèn)之后才彈。
? ? ? ? ? ? if(mypro != null)
? ? ? ? ? ? ?window.open(mypro,'_blank','width=400,height=500,toolbar=no,menubar=no')
? ? ? ? ? ? else
? ? ? ? ? ? ? alert("再見!");
? ? ? ?}
? ? ? ?else
? ? ? ?
? ? ? ? ?alert("結(jié)束!");
? ? ? ??
? ? }
2016-09-22
<script type="text/javascript"> ?
? ? function openWindow(){
? ? ? ? var mycon=confirm("是否確認(rèn)打開網(wǎng)站?")
? ? // 新窗口打開時(shí)彈出確認(rèn)框,是否打開
? ? if(mycon==true){
? ? ? ? var mypr=prompt("輸入網(wǎng)址:","http://idcbgp.cn");
? ? ? ? window.open(mypr,'_blank','width=400,height=500,menubar=no,toolbar=no');
? ? }
? ? // 通過輸入對(duì)話框,確定打開的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ? ? ? }
? </script>