為什么我的完全打不開
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title> ?
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> ??
? <script type="text/javascript"> ?
? function open(){
? ? ? var con=confirm("你確定嗎");
? ? ? if(con ==true)
? ? ? {
? ? ? ? ? var url=prompt("請輸入:" ," http://www.xianlaiwan.cn");
? ? ? ? ? if(url!=null)
? ? ? ? ? {
? ? ? ? ? ? ? window.open(url, '_blank','width:400,height:500,menubar=no,toolbar=no);
? ? ? ? ? }
? ? ? ? ? else{
? ? ? ? ? ? ? alert("再見");
? ? ? ? ? ??
? ? ? ? ? ? ? ? }
? ? ? ? }
? ? ? ?else
? ? ? ?{
? ? ? ? ? ? ? alert("再見"); ?
? ? ? ? }
? ? ?
? }
? ??
? </script>?
?</head>?
?<body>?
?
<input type="button" value="點擊我,有驚喜" onclick="open()" />
?</body>
</html>
2018-04-01
你用的函數名open是 保留字?
換個函數名字試試