為什么我最終打開的網(wǎng)址不是慕課網(wǎng)?
?<head>
? <title> new document </title> ?
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> ??
? <script type="text/javascript"> ?
? ? function openWindow(){
? ? ? ?var st = prompt('是否打開網(wǎng)址?','http://idcbgp.cn');
? ? ? ?if(st){
? ? ? ? ? ?window.open('st','_blank','width=400px,height=500px')
? ? ? ?}
? ? ??
? ? ? ? }
? ? // 新窗口打開時彈出確認(rèn)框,是否打開
? ? // 通過輸入對話框,確定打開的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ??
? ??
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2017-01-16
?window.open('st','_blank','width=400px,height=500px')
這句里的st寫錯了,不應(yīng)該加單引號
2017-01-12
打開的時候網(wǎng)址顯示的我的變量st
2017-01-12
確認(rèn)網(wǎng)址輸入的是否正確? ?