窗口沒打開,麻煩幫看看
<!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 lol=confirm("確定在新窗口打開網址嗎?")
? ? ? ? if(lol==true)
? ? ? ? {
? ? ? ? ? ? var wangzhi=prompt("確定打開網址?,http://www.xianlaiwan.cn/")
? ? ? ? ? ? if(wangzhi!=null)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? window.open(wanhzhi,"_blank",'width=400,height=500,menubar=no,toolbar=no')
? ? ? ? ? ? }
? ? ? ? ? ? else
? ? ? ? ? ? {
? ? ? ? ? ? ? ? alert("再見")
? ? ? ? ? ? }
? ? ? ? }
? ? ? ? else
? ? ? ? {
? ? ? ? ? ? alert("再見")
? ? ? ? }
? ??
? ??
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網站" onclick="openWindow()" />?
?</body>
</html>
2016-07-22
<!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 lol=confirm("確定在新窗口打開網址嗎?");
? ? ? ? if(lol==true)
? ? ? ? {
? ? ? ? ? ? var wangzhi=prompt("確定打開網址?");
? ? ? ? ? ? if(wangzhi=="")
? ? ? ? ? ? {
? ? ? ? ? ?
? ? ? ? ? ? ? ? window.open("http://www.xianlaiwan.cn/","_blank",'width=400,height=500,menubar=no,toolbar=no');
? ? ? ? ? ? }
? ? ? ? ? ??
? ? ? ? ? ? else
? ? ? ? ? ? {
? ? ? ? ? ? ? ? window.open(wanhzhi,"_blank",'width=400,height=500,menubar=no,toolbar=no');
? ? ? ? ? ? }
? ? ? ? }
? ? ? ? else
? ? ? ? {
? ? ? ? ? ? alert("再見")
? ? ? ? }
? ? }
? ??
?</script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網站" onclick="openWindow()" />?
?</body>
</html>
這個我測試過是可以打開,,你最開始的那個也是行的啊 !如果還不行的話,可能是我沒太搞懂你想要表達是什么~你可以自行百度一下吧~
2016-07-22
var wangzhi=prompt("確定打開網址?,http://www.xianlaiwan.cn/")
是不是雙引號漏了,改成:
var wangzhi=prompt("確定打開網址?","http://www.xianlaiwan.cn/")
試試看
?
2016-07-22
你看看你的雙引號
2016-07-22
? ?if(wangzhi=="")
? ? ? ? ? ? {
? ? ? ? ? ?
? ? ? ? ? ? ? ? window.open("http://www.xianlaiwan.cn/");
? ? ? ? ? ? }
? ? ? ? ? ??
? ? ? ? ? ? else
? ? ? ? ? ? {
? ? ? ? ? ? ? ? window.open(wanhzhi);
? ? ? ? ? ? }
你不要設置他彈窗就好了啊
2016-07-22
神?。。。?!你這也是打不開新窗口啊 ? ?是連接窗口 ?不是彈窗啊 ? 我彈窗正常 ?就是連接不到新窗口 widow.open沒起作用?。。?!
2016-07-22
<!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 lol=confirm("確定在新窗口打開網址嗎?");
? ? ? ? if(lol==true)
? ? ? ? {
? ? ? ? ? ? var wangzhi=prompt("確定打開網址?");
? ? ? ? ? ? if(wangzhi=="")
? ? ? ? ? ? {
? ? ? ? ? ?
? ? ? ? ? ? ? ? window.open("http://www.xianlaiwan.cn/","_blank",'width=400,height=500,menubar=no,toolbar=no');
? ? ? ? ? ? }
? ? ? ? ? ??
? ? ? ? ? ? else
? ? ? ? ? ? {
? ? ? ? ? ? ? ? window.open(wanhzhi,"_blank",'width=400,height=500,menubar=no,toolbar=no');
? ? ? ? ? ? }
? ? ? ? }
? ? ? ? else
? ? ? ? {
? ? ? ? ? ? alert("再見")
? ? ? ? }
? ? }
? ??
?</script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網站" onclick="openWindow()" />?
?</body>
</html>