我彈不出來(lái)結(jié)果,怎么回事???
<!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 ask=confirm("你確定要打開(kāi)新的網(wǎng)站?");
? ? ? ??
? ? // 新窗口打開(kāi)時(shí)彈出確認(rèn)框,是否打開(kāi)
? ? if (ask==true)
? ? {
? ? ? ? var url;
? ? ? ? url=prompt("請(qǐng)輸入你想輸入的網(wǎng)址:","你輸入的網(wǎng)址是:");
? ? ? ? if url!=null
? ? ? ? {
? ? ? ? window.open(url,'_blank','width=400,hight=500,menubar=no,toobar=no');
? ? ? ? }
? ? ? ? else{alert("byeBye!");}
? ? }
? ??
? ? // 通過(guò)輸入對(duì)話(huà)框,確定打開(kāi)的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
? ? //打開(kāi)的窗口要求,寬400像素,高500像素,無(wú)菜單欄、無(wú)工具欄。
? ? else
? ? {
? ? window.open('http://www.baidu.com/','_blank');
? ? window.close();
? ? }
? ? }
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開(kāi)網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2015-03-30
if url!=null ? 這行是什么意思?if后面咋沒(méi)有括號(hào)
2015-03-30
是哦,謝謝!