大家?guī)兔纯?,代碼運(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("是否打開");
? ? if(mymessage==true)
? ? {
? ? ? ? var talk=prompt("請輸入網(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="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2016-03-27
設(shè)置瀏覽器窗口的寬高度的值沒有雙引號
2016-03-27
? var mymessage=confirm("是否打開");
這句結(jié)尾使用了中文的分號
2016-03-27
我覺的是不是沒有輸入窗口名稱屬性啊
2016-03-27
注意window.open()函數(shù)的語法:
2016-03-27
?open window.('talk','width=400,height=500,menubar=no,toolbar=no');