提交后顯示通過但是點擊右側打開新建進行測試發現沒有反應
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title>?
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/>??
? <script type="text/javascript">?
??? var determine=confirm("是否打開?","http://www.baidu.com/");
??? // 新窗口打開時彈出確認框,是否打開
??? if(determine==true)
??? {window.open('http://www.baidu.com/','width=400','height=500','menubar=no','toolbar=no');}
??? // 通過輸入對話框,確定打開的網址,默認為 http://www.xianlaiwan.cn/
??? else
??? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
??? {window.close()}
???
? </script>
?</head>
?<body>
?? <input type="button" value="新窗口打開網站" onclick="openWindow()" />
?</body>
</html>
不知道是程序錯了還是網站錯了
2019-03-24
?var mymessage= confirm("是否打開?http://www.baidu.com");
2019-03-24
<!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 determine=confirm("是否打開?","http://www.baidu.com/");
??? // 新窗口打開時彈出確認框,是否打開
??? if(determine==true)
??? {window.open('http://www.baidu.com/','width=400','height=500','menubar=no','toolbar=no');}
??? // 通過輸入對話框,確定打開的網址,默認為 http://www.xianlaiwan.cn/
??? else
??? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
??? {window.close()};
??? }
???
? </script>
?</head>
?<body>
?? <input type="button" value="新窗口打開網站" onclick="openWindow()" />
?</body>
</html>
2019-03-24
你需要先構造函數 function openWindow()
這里是按鈕調用函數,你沒有先構造出這個函數,當然不會起作用了