請(qǐng)問(wèn)大神,有一個(gè)小問(wèn)題,彈窗的時(shí)候我進(jìn)行切屏,會(huì)自動(dòng)打開(kāi)慕課網(wǎng)頁(yè),是為什么呢?
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title>??
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/>? ?
? <script type="text/javascript">?
??
? ? function openWindow(){
? ? ? ? // 新窗口打開(kāi)時(shí)彈出確認(rèn)框,是否打開(kāi)
? ? ? ? var open = confirm("請(qǐng)確認(rèn)是否打開(kāi)網(wǎng)站");
? ? ? ? // 通過(guò)輸入對(duì)話框,確定打開(kāi)的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
? ? ? ? if(open==true){
? ? ? ? ? ? var ask = prompt("請(qǐng)確認(rèn)要打開(kāi)的網(wǎng)址","http://idcbgp.cn/");
? ? ? ? ? ? if(ask=="http://idcbgp.cn/"){
? ? ? ? ? ? ? ? //打開(kāi)的窗口要求,寬400像素,高500像素,無(wú)菜單欄、無(wú)工具欄。
? ? ? ? ? ? ? ? window.open('http://idcbgp.cn','_blank','width=400,height=500')
? ? ? ? ? ? }else{
? ? ? ? ? ? ? ? elask = prompt("請(qǐng)確認(rèn)要打開(kāi)的網(wǎng)址");
? ? ? ? ? ? ? ? window.open(elask,'_blank','width=400,height=500')
? ? ? ? ? ? }
? ? ? ? }else{
? ? ? ? ? ? alert("打開(kāi)網(wǎng)站失敗!");
? ? ? ? }
? ? }
? ??
? </script>?
?</head>?
?<body>?
? <input type="button" value="新窗口打開(kāi)網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2020-08-02