請問為什么彈不出對話框?
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title>?
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/>??
? <script type="text/javascript">?
??? function opeWindow(){
??????? var insure=confirm("確認打開新窗口嗎?");
??????? //彈出對話框,是否打開
??????? if(insure==true){
??????????? var newwin=prompt("輸入打開的網址:","http://www.xianlaiwan.cn/");
??????? //輸入對話框,確定打開網站,默認http://www.xianlaiwan.cn/?
??????????? if(newwin!=null){window.open('newwin','width=400,height=500,menubar=no,toolbar=no');
??????????? }
??????? //打開的窗口要求。
??????? }
??????? else return null;
??? }
? </script>
?</head>
?<body>
?? <input type="button" value="新窗口打開網站" onclick="openWindow()" />
?</body>
</html>
2018-07-10
不用啦 我找到問題了,我前面函數名打錯了,后面沒有辦法調用 ?
2018-07-10
有個分號的中文的,我改成英文后還是不能彈出對話框