大家幫忙看看,代碼運行不出最后的效果
<!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("請輸入網址");
? ? ? ? window.open('talk','width=400,height=500,menubar=no,toolbar=no');
? ? }
? ? else
? ? {
? ? ? ? window.open('http://www.xianlaiwan.cn','width=400,height=500,menubar=no,toolbar=no'); ??
? ? }
? ? } ?
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網站" onclick="openWindow()" />?
?</body>
</html>
2016-03-27
設置瀏覽器窗口的寬高度的值沒有雙引號
2016-03-27
? var mymessage=confirm("是否打開");
這句結尾使用了中文的分號
2016-03-27
我覺的是不是沒有輸入窗口名稱屬性啊
2016-03-27
注意window.open()函數的語法:
2016-03-27
?open window.('talk','width=400,height=500,menubar=no,toolbar=no');