2 回答

TA貢獻(xiàn)16條經(jīng)驗(yàn) 獲得超7個(gè)贊
你的函數(shù)名不是 aaa嗎?按鈕的onclick應(yīng)該等于"aaa()"才對;話說,var =confirm("是否打開"); ?這個(gè)是不是語法上寫錯(cuò)了...

TA貢獻(xiàn)1條經(jīng)驗(yàn) 獲得超0個(gè)贊
現(xiàn)在改過來 還是打不開? ?搞不明白了....
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title> ?
? <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> ??
? <script type="text/javascript"> ?
? ? ?function aaa()
{
? ? ? ? var bbb =confirm("是否打開");
if(bbb==ture)
{
? ? var ccc=prompt("請輸入網(wǎng)址:","http://widcbgp.cn/")
if(ccc != null){
?
? ? ? ? ?window.open(ccc,'_blank','width=400px,height=500px,menubar=no,toolbar=no')
}else
? ? { alert("再見");} ?
? ? ? ? }else?
{alert("再見");}
}
? ? // 新窗口打開時(shí)彈出確認(rèn)框,是否打開
??
? ? // 通過輸入對話框,確定打開的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
??
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ? ??
? ? ??
? </script>?
?</head>?
?<body>?
? <input type="button" value="新窗口打開網(wǎng)站" onclick="aaa()" />?
?</body>
</html>
添加回答
舉報(bào)