最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

怎么調(diào)用鏈接,大神?


<!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 abc=prompt("確認(rèn)打開這個(gè)網(wǎng)址嗎?", "http://yifanck.cn");
? ? ? ? ? ?if(abc!=null)
? ? ? ? ? ?{
? ? ? ? ? ? ? ?alert(window.open('url', '_blank','width=400,height=500,menubar=no,toolbar=no'))
? ? ? ? ? ?}
? ? ? ? ? ?else
? ? ? ? ? ?{
? ? ? ? ? ? ? ?abc.close()
? ? ? ? ? ?}
? ?</script>
</head>
<body>
<input type="button" value="新窗口打開網(wǎng)站" onClick="openWindow()" />
</body>
</html>

點(diǎn)button沒反應(yīng)

正在回答

4 回答

<!DOCTYPE html>

<html>

?<head>

? <title> new document </title> ?

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

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

? ??

? function openWindow(){?

? ? ? confirm("是否打開網(wǎng)站");// 新窗口打開時(shí)彈出確認(rèn)框,是否打開

var abc=prompt("輸入要打開的網(wǎng)址","http://");

? ? if(abc==null)// 通過輸入對(duì)話框,確定打開的網(wǎng)址,默認(rèn)為 http://yifanck.cn/

{}else{

? ? window.open(abc,'_block','width=400px,height=500px,menubar=no,toolbar=no')

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

? ?

? }

? </script>?

?</head>?

?<body>?

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

?</body>

</html>

這個(gè)是我的作業(yè)你可以參考一下

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

金潭村的小菜鳥 提問者

非常感謝!function后面的大括號(hào)錯(cuò)了
2017-09-09 回復(fù) 有任何疑惑可以回復(fù)我~
#2

web前端小白進(jìn)階

噢這種問題都是很難發(fā)現(xiàn)的小毛病,以后一定要注意必須在英文狀態(tài)下輸入
2017-09-11 回復(fù) 有任何疑惑可以回復(fù)我~

<!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 abc=prompt("確認(rèn)打開這個(gè)網(wǎng)址嗎?");
? ? ? ? ? ?if(abc!=null)
? ? ? ? ? ?{
? ? ? ? ? ? ? ?window.open('http://yifanck.cn','_blank','width=400,height=500,menubar=no,toolbar=no');

? ? ? ? ? ?}
? ? ? ? ? ?else
? ? ? ? ? ?{
? ? ? ? ? ? ? ?abc.close()
? ? ? ? ? ?}
? ?</script>
</head>
<body>
<input type="button" value="新窗口打開網(wǎng)站" onClick="openWindow()" />
</body>
</html>

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

web前端小白進(jìn)階

你這個(gè)不管輸入什么網(wǎng)站都只能打開慕課網(wǎng)
2017-09-07 回復(fù) 有任何疑惑可以回復(fù)我~

url換成abc

0 回復(fù) 有任何疑惑可以回復(fù)我~

??alert(window.open('url', '_blank','width=400,height=500,menubar=no,toolbar=no'))去掉alert試一試


0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消
JavaScript入門篇
  • 參與學(xué)習(xí)       741559    人
  • 解答問題       9869    個(gè)

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

進(jìn)入課程

怎么調(diào)用鏈接,大神?

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

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

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

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