大家?guī)兔纯矗a運(yùn)行不出最后的效果
<!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 mymessage=confirm("是否打開(kāi)");
? ? if(mymessage==true)
? ? {
? ? ? ? var talk=prompt("請(qǐng)輸入網(wǎng)址");
? ? ? ? window.open('talk','width=400,height=500,menubar=no,toolbar=no');
? ? }
? ? else
? ? {
? ? ? ? window.open('http://idcbgp.cn','width=400,height=500,menubar=no,toolbar=no'); ??
? ? }
? ? } ?
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開(kāi)網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2016-03-27
設(shè)置瀏覽器窗口的寬高度的值沒(méi)有雙引號(hào)
2016-03-27
? var mymessage=confirm("是否打開(kāi)");
這句結(jié)尾使用了中文的分號(hào)
2016-03-27
我覺(jué)的是不是沒(méi)有輸入窗口名稱屬性啊
2016-03-27
注意window.open()函數(shù)的語(yǔ)法:
2016-03-27
?open window.('talk','width=400,height=500,menubar=no,toolbar=no');