點擊打不開,求解!
<!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 url;
? ? ? ? ? url = prompt("請輸入網(wǎng)址");
? ? ? ? ? if(url== 'http://idcbgp.cn/')// 通過輸入對話框,確定打開的網(wǎng)址,默認為 http://idcbgp.cn/{
? ? ? ? ? ? Window.open('http://idcbgp.cn/','width=400px',"height=500px",'menubar=no',"toolbar=no");//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ? ? ? ? }
? ? ? ?}
? ? }
? ??
? ??
? </script>?
?</head>?
?<body>?
? <input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2019-12-08
我做了四個更改,可以運行了
①把;都改為;(改為英文的分號)
②把第一個if語句的條件用()括起來
③把第二個if語句的 { 換行
④把Window.open的W改成w
2019-12-08
第一,第一個if語句條件要用()括起來;
第二,第二個if語句后面的注釋把 { 給注釋掉了;
第三,window.open()語句的字母都是小寫的。
2019-12-05
17,19,21,25,35行都有點問題,你看著我給你那個改
2019-12-05
<!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?url=?prompt("請輸入網(wǎng)址")
??????????if(url==?'http://idcbgp.cn/')//?通過輸入對話框,確定打開的網(wǎng)址,默認為?http://idcbgp.cn/{
????????????Window.open('http://idcbgp.cn/','width=400px',"height=500px",'menubar=no',"toolbar=no");//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
??????????}
???????}
????
????
????
??</script>?
?</head>?
?<body>?
??<input?type="button"?value="新窗口打開網(wǎng)站"?onclick="openWindow()"?/>?
?</body>
</html>
2019-12-02
?function?openWindow(){
????var?mywin?=?confirm("是否打開該窗口?");//?新窗口打開時彈出確認框,是否打開
????if?(mywin?==true){
?????????????var?mywindow;
?????????????mywindow?=?prompt("請輸入網(wǎng)址","http://idcbgp.cn/");
?????????if(mywindow?==?"http://idcbgp.cn/") { //?通過輸入對話框,確定打開的網(wǎng)址,默認為?http://idcbgp.cn/
??????????window.open('http://idcbgp.cn/','width=400px','height=500px','menubar=no','toolbar=no');//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
????}
???????}
????}
走你
2019-12-02
?function?openWindow(){
????var?mywin?=?confirm("是否打開該窗口?");//?新窗口打開時彈出確認框,是否打開
????if?(mywin?==true){
?????????????var?mywindow;
?????????????mywindow?=?prompt("請輸入網(wǎng)址");
?????????if(mywindow?==?"baidu") { //?通過輸入對話框,確定打開的網(wǎng)址,默認為?http://idcbgp.cn/
??????????window.open('http://www.baidu.com/','width=400px','height=500px','menubar=no','toolbar=no');//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
????}
???????}
????}
2019-12-02
if后面的小括號呢