為什么我這樣寫 網頁不彈出來?
啦啦啦啦啦
? ? function openWindow(){
? ? ? ? var open=confirm("是否打開");
? ? ? ? if(open==true)
? ? ? ? {
? ? ? ? ? ? window.open('http://www.xianlaiwan.cn','_blank','width=600,height=400,top=100,left=0, status=no,scrollbars=yes')
? ? ? ? }
? ? ? ? else
? ? ? ? {
? ? ? ? ? ? alert("再見")
? ? ? ? }
? ? }
? ??
2019-03-18
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title>??
? <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>? ?
? <script type="text/javascript">??
? ? ? function openWindow(){
? ? ? ? ? var a=confirm("是否打開新窗口");
? ? ? ? ? if(a==true){
? ? ? ? ? ? ? var newweb=prompt('確認打開的網址:','http://www.xianlaiwan.cn');
? ? ? ? ? ? ? if(newweb!=null){
? ? ? ? ? ? ? ? ? ?window.open('http://www.xianlaiwan.cn','_blank','width=400,height=500,menubar=no,toolbar=no')
? ? ? ? ? ? ? }
? ? ? ? ? ? ? else{
? ? ? ? ? ? ? ? alert(2);
? ? ? ? ? ? ? }
? ? ? ? ? }
? ? ? ? ? else{
? ? ? ? ? ? alert(5);
? ? ? ? ? }
? ? ? }? ?
? </script>?
?</head>?
?<body>?
? <input type="button" value="新窗口打開網站" onclick="openWindow()" />?
?</body>
</html>
2019-03-11
可能是被你的瀏覽器攔截了