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

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

為什么我的運行不了?點擊按鈕也沒反應

<!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?ccc=confirm("你想要打開新窗口嗎?");//?新窗口打開時彈出確認框,是否打開
????if(ccc==true)
????{
???????var?aaa=prompt("請輸入網(wǎng)址:""http://idcbgp.cn/")
???????if(aaa!=null){
????????alert("歡迎進入");
????????window.open("http://idcbgp.cn/","_blank""width=400,height=500,menubar=no,toolbar=no");??
???????}
???????else{alert("請輸入地址");}
????}
????else{
?????????document.write("下次再見");????
????}???
????}//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
???
??</script>?
?</head>?
?<body>?
	??<input?type="button"?value="新窗口打開網(wǎng)站"?onclick="openWindow()"?/>?
?</body>
</html>


正在回答

5 回答

你的邏輯沒有問題,但是太馬虎了,你嵌套的if語句缺少閉合符號},函數(shù)名openWindow前后不一樣,還有一個?var?aaa=prompt("請輸入網(wǎng)址:""http://idcbgp.cn/")兩個屬性間缺少逗號,另外不知道你的符號是否都是英文狀態(tài),最好自己調(diào)一調(diào),我前幾天因為缺少一個分號調(diào)了半天,希望共勉。

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

<!DOCTYPE HTML>

<html>

?<head>

? ?

? <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> ?

? <title> new document </title>?

? <script type="text/javascript">

? function Wopen(){

?

? ? ?window.open('http://idcbgp.cn','_blank','width=300,height=200,menubar=no,toolbar=no, status=no,scrollbars=yes ');


? }

?

? function winopen(){

? ? ? // 新窗口打開時彈出確認框,是否打開

? ? var myopen = confirm("是否打開新窗口");

// var shu = prompt('輸入你想要打開的網(wǎng)址'); ? prompt這是個對話框 ?不能打開外部鏈接

? ? if(myopen==true){

? ?

? ? ? ? window.open('http://idcbgp.cn', '_top ' , ' width=400 , height=500 , menubar=no ,toolbar=no , status=no ,scrollbars=yes ');

? ? }

? ? else{

? ? ? ? myopen.close();

? ? }

?}

? ?

? </script>?

?</head>?

?<body>?

?<input name="button" type="button" ?onClick="winopen()" value="新窗口打開網(wǎng)站"/>?

?<input name="button" type="button" onClick="Wopen()" value="點擊我,打開新窗口!" / >

?</body>

</html>

?我也是剛寫過類似的 就是prompt的問題 ? 我給他注了

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

prompt 是個對話框,好像不能輸入地址或者路徑

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

有幾個錯誤,meta里charset=UTF-8,兼容中文;script里的函數(shù)名openWindow的W應該是大寫;prompt里面的兩個輸入之間用逗號隔開;window.open的窗口名稱與參數(shù)字符串之間用逗號隔開。

代碼如下:

<!DOCTYPE html>

<html>

?<head>

? <title> new document </title> ?

? <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> ??

? <script type="text/javascript"> ?

? ? function openWindow(){

? ? var ccc=confirm("你想要打開新窗口嗎?");// 新窗口打開時彈出確認框,是否打開

? ? if(ccc==true)

? ? {

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

? ? ? ?if(aaa!=null){

? ? ? ? alert("歡迎進入");

? ? ? ? window.open("http://idcbgp.cn/","_blank","width=400,height=500,menubar=no,toolbar=no"); ?

? ? ? ?}

? ? ? ?else{alert("請輸入地址");}

? ? }

? ? else{

? ? ? ? ?document.write("下次再見"); ? ?

? ? } ??

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

? ??

? </script>?

?</head>?

?<body>?

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

?</body>

</html>


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

onclick="openWindow()" 關(guān)聯(lián)的是openWindow這個名字,你命名沒一致,換下名字openWindow為ccc

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

上善若水L

看錯了,忽略它?
2017-08-01 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
JavaScript入門篇
  • 參與學習       741065    人
  • 解答問題       9797    個

JavaScript做為一名Web工程師的必備技術(shù),本教程讓您快速入門

進入課程

為什么我的運行不了?點擊按鈕也沒反應

我要回答 關(guān)注問題
微信客服

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

幫助反饋 APP下載

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

公眾號

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