亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

為什么是打開的http://www.xianlaiwan.cn/code/www.xianlaiwan.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 newWindow=confirm("是否打開網站?")

? ? // 通過輸入對話框,確定打開的網址,默認為 http://www.xianlaiwan.cn/

? ? if(newWindow==true){

? ? ? ? var http=prompt("請輸入網址","http:www.xianlaiwan.cn")

? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。

? ? window.open(http,'_blank','width=400,height=500,menubar=no,toolbar=no') ? ?

? ? ? ? } ? ? ? ?

? ? } ??

? </script>?

?</head>?

?<body>?

?<input type="button" value="新窗口打開網站" onclick="openWindow()" />?

?</body>

</html>?


正在回答

6 回答

我也是 ?解決了么

0 回復 有任何疑惑可以回復我~

我開始也出現了這個問題 可能是JS的版本問題,但是解決方法如下

? function openWindow(){

? ? ? ? var url = confirm("是否打開新網頁");

? ? // 通過輸入對話框,確定打開的網址,默認為 http://www.xianlaiwan.cn/

? ? ? ?if (url == true){

? ? ? ? ? ?var url = prompt("請輸入要打開的網址:","www.xianlaiwan.cn") ;?

? ? ? ? ? ?document.write(win);

? var html = "http://"+win ;

? document.write(html);

? ? ? ? ? ? window.open(html,'_blank','width= 400 height= 500','menubar =no','toolbar=no')

? ? }

前面加上一個http://? 再創建一個新的var ?就可以改變新窗口的路徑

0 回復 有任何疑惑可以回復我~

據我實驗,貌似是這樣。prompt已經包括http告訴瀏覽器協議了,window.open后面如果再寫網址就重復了。

0 回復 有任何疑惑可以回復我~

? ? function openWindow(){

? ? ? ? var msg=confirm("open new website?")

? ? ? ? var newwind="http://www.xianlaiwan.cn/"

? ? ? ? if(msg==true){

? ? ? ? ? ? prompt("Key in the address: ", "www.xianlaiwan.cn/");

? ? ? ? ? ? window.open(newwind, "_blank", "width=400px, height=500px, menubar=no, toolbar=no");

? ? ? ? }

}


0 回復 有任何疑惑可以回復我~

<script type="text/javascript"> ?

? ?function openWindow(){

? ? var s=confirm("確認要打開新網站嗎?"); ??

? ? if(s){window.open('http://www.xianlaiwan.cn','_blank','width=400px,height=500px,menubar=no,toolbar=no')

? ?}? </script>


0 回復 有任何疑惑可以回復我~

地址寫錯了 。。。http://www.xianlaiwan.cn? ?你少“//”了

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

為什么是打開的http://www.xianlaiwan.cn/code/www.xianlaiwan.cn,問題出在哪

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號