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