為什么地址欄會出現(xiàn)兩次http://idcbgp.cn/?
<!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 sureResult=confirm("是否打開新窗口?")
??? if(sureResult==true){
??? // 通過輸入對話框,確定打開的網(wǎng)址,默認為 http://idcbgp.cn/
??????? var url=prompt("請輸入要跳轉(zhuǎn)到的網(wǎng)頁地址:","http://idcbgp.cn/")
??????? alert(url)
??? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。? ?
??????? window.open(url,'_blank','weidth=400,height=500,menubar=no,toolbar=no')
??? }
??? else{ }
??? }
? </script>
?</head>
?<body>
?? ?? <input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />
?</body>
</html>
2018-10-17
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title>??
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/>? ?
? <script type="text/javascript">??
? ??
? ? // 新窗口打開時彈出確認框,是否打開
? ? // 通過輸入對話框,確定打開的網(wǎng)址,默認為 http://idcbgp.cn/
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ? function openWindow(){
? ? ? ? new1=confirm("是否打開新窗口");
? ? ? ? if (new1==true){
? ? ? ? var my=window.open("http://idcbgp.cn/","_blank","width=400px,height=500px,menubar=no,stoolbar=no")}
? ? ? ??
? ? }
? ??
? </script>?
?</head>?
?<body>?
? <input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2018-10-16
找到原因了,仔細觀察地址斜杠處,圖中已加紅色下劃線示意。題目給的是地址是錯的!??!正確寫法如代碼所示。
2018-10-16
地址欄總是重復(fù)指定網(wǎng)址,有人遇到嗎?有童鞋有解決方法?