求大神指教,謝謝啦
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title> ?
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> ??
? <script type="text/javascript"> ?
? ? function=openWindow()
? ? window.open("http://yifanck.cn/")
? ? var mymessage=confirm("是否打開(kāi)?")
? ? if(mymessage==true)
? ? {window.open("http://yifanck.cn/","width=400","height=500","menubar=no","toolbar=no")}
? ? else
? ? {window.close("http://yifanck.cn/")} ?
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開(kāi)網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
不知道錯(cuò)在了哪里
2016-10-18
function函數(shù)寫錯(cuò)了,修改及說(shuō)明:
function openWindow()
{
??? //window.open(http://yifanck.cn/)?? 如果這里這么寫,程序解析到這里是會(huì)先打開(kāi)一個(gè)網(wǎng)頁(yè);這句刪掉
? ? var mymessage=confirm("是否打開(kāi)?")
? ? if(mymessage==true)
? ? {window.open("http://yifanck.cn/","width=400","height=500","menubar=no","toolbar=no")}
??? //else? ?{window.close("http://yifanck.cn/")} ? else 可以不寫else語(yǔ)句,表示不操作;或者隨便寫一個(gè) document.write("您選擇不打開(kāi)網(wǎng)頁(yè)")
}? //注意別漏掉函數(shù)的另一個(gè)大括號(hào)
2016-10-18
function函數(shù)寫錯(cuò)了,修改及說(shuō)明:
function openWindow()
{
??? //window.open(http://yifanck.cn/)?? 如果這里這么寫,程序解析到這里是會(huì)先打開(kāi)一個(gè)網(wǎng)頁(yè);這句刪掉
? ? var mymessage=confirm("是否打開(kāi)?")
? ? if(mymessage==true)
? ? {window.open("http://yifanck.cn/","width=400","height=500","menubar=no","toolbar=no")}
??? //else? ?{window.close("http://yifanck.cn/")} ? else 可以不寫else語(yǔ)句,表示不操作;或者隨便寫一個(gè) document.write("您選擇不打開(kāi)網(wǎng)頁(yè)")
}? //注意別漏掉函數(shù)的另一個(gè)大括號(hào)
2016-10-18
else
? ? {window.close("http://yifanck.cn/")}?
你問(wèn)的是否打開(kāi)網(wǎng)站,還沒(méi)打開(kāi)怎么關(guān)閉?