大佬們幫我看k代碼,窗口就是出不來。。。
<!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 a=confirm("是否打開新窗口?");
? ? if(a)
? ? {
? ? var b=prompt("請輸入網址: ","http://www.xianlaiwan.cn/")
? ? window.open(url,"_blank",'width=400px, height=400px,menebar=no,toolbar=no')
? ? }
? ?}
? ??
? ??
? ? // 新窗口打開時彈出確認框,是否打開
? ? // 通過輸入對話框,確定打開的網址,默認為 http://www.xianlaiwan.cn/
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ??
? ??
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網站" onclick="openWindow()" />?
?</body>
</html>
2017-08-07
<!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 a=confirm("是否打開新窗口?");
? ? if(a)
? ? {
? ? var b=prompt("請輸入網址: ","http://www.xianlaiwan.cn/")
? ? window.open("http://www.xianlaiwan.cn/","_blank",'width:400, height:400,menebar:no,toolbar:no')
? ? }
? ?}
2017-08-07
其實應該將b改為url,你采納的回答是默認打開的都是慕課網站,而輸入提示框里只是默認是慕課網站,如果你把網址改成其他網址,肯定是需要調到其他網頁的呀!
2017-08-07
?var b=prompt("請輸入網址: ","http://www.xianlaiwan.cn/") ? 將b改為url