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