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

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

為什么點了沒反應

<!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 open=confirm("是否新建窗口來打開網站?");

? ? ? if(open==true)

? ? ? ? ?{

? ? ? ? ? ? ?var address = prompt("請您輸入想打開的網站:","http://www.xianlaiwan.cn/");

? ? ? ? ? if(address!=null)

? ? ? ? ? ? ?{window.open('address','_blank','menubar=no,toolbar=no,height=500,weight=400');

? ? ? ? ? ? ?}

? ? ? ? ? ? ?else{

? ? ? ? ? ? ? ? ?alert("再見!");

? ? ? ? ? ? ?}

? ? ? ? ?}

? ? ? ? ?else{

? ? ? ? ? ? ? alert("保持在當前頁面");

? ? ? ? ?}

? ? ?}

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


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


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

? ??

? ??

? </script>?

?</head>?

?<body>?

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

?</body>

</html>


正在回答

3 回答

<!DOCTYPE HTML>
?<html>
??<head>
???<script>
????function abb(){
????var aab=confirm("是否打開網址?")
????if(aab=true){
????var acc=prompt("請輸入網址","http://www.baidu.com")
?????if(acc!=null){
?????window.open('http://www.baidu.con','_blank','width=500,height=200,top=100,left=500','toolbar=no','menubar=no')
?????}
?????else{
?????alert("拜拜!")
?????}
????}
????else{
????document.write("拜拜哦!")
????}
????}
????function add(){
????abb.close();
????}
???</script>
??</head>
??<body>
???<input type="button" value="點擊進入網址" onclick="abb()">
???<input type="button" value="關閉網址" onclick="add()">
??</body>
??</html>

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

慕前端0798377

==true變成=true
2018-07-26 回復 有任何疑惑可以回復我~

我知道了,你的最后一個else的括號用成了中文狀態的了

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

emem不知道怎么改,但是我的是這樣寫的,

<!DOCTYPE html>
<html>
?? ?<head>
?? ??? ?<meta charset="UTF-8">
?? ??? ?<script type="text/javascript">
?? ??? ??? ?// 新窗口打開時彈出確認框,是否打開
?? ??? ??? ?function open1(){
?? ??? ??? ??? ?var a1=confirm("是否真的打開新窗口?");
?? ??? ??? ??? ?if (a1==true) {
?? ??? ??? ??? ??? ?window.open();
?? ??? ??? ??? ?} else{
?? ??? ??? ??? ??? ?close();
?? ??? ??? ??? ?}
?? ??? ??? ?}
?? ??? ??? ?// 通過輸入對話框,確定打開的網址,默認為 http://www.xianlaiwan.cn/
?? ??? ??? ?function open2(){
?? ??? ??? ??? ?var a2=prompt("是否真的打開?");
?? ??? ??? ??? ?if (a2==0) {
?? ??? ??? ??? ??? ?window.open('http://www.xianlaiwan.cn/');
?? ??? ??? ??? ?}
?? ??? ??? ??? ?
?? ??? ??? ?}
?? ??? ??? ?
?? ??? ??? ?//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
?? ??? ??? ?function open3 () {
?? ??? ??? ??? ?window.open('http://www.xianlaiwan.cn','_blank','height=500,width=400,menubar=0,toolbar=0');
?? ??? ??? ?}
?? ??? ??? ?
?? ??? ?</script>
?? ??? ?<title>我的練習</title>
?? ?</head>
?? ?<body>
?? ??? ?<input name="button1"? type="button" onclick="open1()" value="是否打開新窗口!"/>
?? ?</br>
?? ???? <input name="button2"? type="button" onclick="open2()" value="打開新網址"/>
?? ?</br>
?? ???? <input name="button3"? type="button" onclick="open3()" value="打開一個寬400像素,高500像素,無菜單欄、無工具欄的窗口"/>
?? ?</br>
?? ?</body>
</html>


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

舉報

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

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

進入課程

為什么點了沒反應

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

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

幫助反饋 APP下載

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

公眾號

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