我現在的想法是在open3為false的時候返回的是open4也就是再次可以輸入網址,但是么有作用
<!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("是否需要在新窗口中打開?")
if(open==true)
{var open2 = prompt("請輸入網址:","http://www.baidu.com");
}else if(open==false)
{var open3 = confirm("確定不需要打開么?");}
if(open3 ==true)
{window.close}
}else{var open4 = prompt("請輸入網址:","http://www.baidu.com");}
if(open2!=null)
{window.open(open2,"_blank","hight=500,width=400");
}else{artle("退出");}
? ? }
?
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網站" onclick="openWindow()" />?
?</body>
</html>
2015-12-16