第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

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

為何執(zhí)行的時候不打開窗口。window.open(url,這個url加引號打開的網(wǎng)址是 http://idcbgp.cn/code/url ,復制答案代碼也是打開http://idcbgp.cn/code/url

function openWindow()// 新窗口打開時彈出確認框,是否打開

? ?{

? ? ?var mymessage= confirm("是否打開窗口?")?

? ?if (mymessage==true)??

? ?{openurl();}

? ?else{}

? ?}

? ?

? ?function openurl()// 通過輸入對話框,確定打開的網(wǎng)址,默認為 http://idcbgp.cn/

? ?{

? ? ?var url = prompt("請輸入一個網(wǎng)址","http://idcbgp.cn/");??

? ? ?if(url=="http://idcbgp.cn/")

? ? ?{

? ? ? Wopen();

? ? ?}

? ? ?else

? ? ?{Wopen();}

? ?}

? ??

? ? function Wopen()

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

? ? {

? ? ? ?window.open(url,"_blank","toolbar=no, menubar=no, scrollbars=yes,? width=400, height=400") ;

? ? }


正在回答

6 回答

???? ???? function openWindow(){
?? ??? ??? ?// 新窗口打開時彈出確認框,是否打開
?? ???????? if(confirm("是否打開網(wǎng)頁")){
?? ??????? ??? ?//通過openW函數(shù)來獲取網(wǎng)址
?? ???????????? var url=openW();
?? ???????????? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄
?? ???????????? window.open(url,"width=400px","toolbar=no", "menubar=no","height=500px");
?? ???????? }
?? ???? }
?? ???? function openW(){
?? ??? ??? ?//將獲取的網(wǎng)址默認為:"http://idcbgp.cn/"
?? ???????? return prompt("請輸入網(wǎng)址","http://idcbgp.cn/");
??? }

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

慕運維2208324 提問者

非常感謝!
2017-11-11 回復 有任何疑惑可以回復我~

window.open(url),是默認打開“相對路徑+url"的,試一下window.open("http://"?+ url, arg1, arg2),

例如:

var arg_url = prompt("url", "http://"?+ url, "_blank", "width=400, height=500")

}else{

return;}

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

去掉兩個函數(shù)定義終于能通過了,可是輸入地址如果是www.baidu.com還是感覺有點怪,會打開頁面http://idcbgp.cn/code/www.baidu.com

--------

function openWindow()// 新窗口打開時彈出確認框,是否打開

? ?{

? ? ?var mymessage= confirm("是否打開窗口?")?

? ?if (mymessage==true)??

? ?{var url = prompt("請輸入一個網(wǎng)址","http://idcbgp.cn/");}

? ?window.open(url,"_blank","toolbar=no, menubar=no, scrollbars=yes,? width=400, height=400") ;

? ?}


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

function Wopen()
//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
{
? ?window.open("url","_blank","toolbar=no, menubar=no, scrollbars=yes, ?width=400, height=400") ;
}

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

window.open(URL,"_blank","toolbar=no", "menubar=no","width=400", "height=400");//這里每一個屬性都需要用引號

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

慕運維2208324 提問者

在blank后面的可以一個引號括起來的
2017-11-11 回復 有任何疑惑可以回復我~

?? ? function openWindow(){
?? ????? var mymessage= confirm("是否打開窗口?")
?? ??? ? if (mymessage==true){
?? ??? ? ?? ?var URL=openurl();
?? ??? ? ?? ?Wopen();
?? ??? ? }
?? ? }
?? ? // 通過輸入對話框,確定打開的網(wǎng)址,默認為 http://idcbgp.cn/
? ??? ? function openurl(){
?? ??? ?? return prompt("請輸入一個網(wǎng)址","http://idcbgp.cn/");
?? ? }
??? function Wopen()
??? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
??? {
?????? window.open(URL,"_blank","toolbar=no", "menubar=no","width=400", "height=400");
??? }

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

慕運維2208324 提問者

最后打開的鏈接是:http://idcbgp.cn/code/function%20URL()%20%7B%20[native%20code]%20%7D
2017-11-11 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

為何執(zhí)行的時候不打開窗口。window.open(url,這個url加引號打開的網(wǎng)址是 http://idcbgp.cn/code/url ,復制答案代碼也是打開http://idcbgp.cn/code/url

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

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號