能打開網(wǎng)頁,但是else的內(nèi)容顯示不了
<!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 talk=confirm("是否打開網(wǎng)頁?");
? ? ? if(talk==true)
? ? ? {
? ? ? ? ? var fz=prompt("請(qǐng)輸入網(wǎng)頁","http://idcbgp.cn");
? ? ? ? ? if(fz==null);
? ? ? ? ? {
? ? ? ? ? ? ?
? ? ? ? ? ? ? document.wirte("y");
? ? ? ? ? }
? ? ? ? ? else
? ? ? ? ? {
? ? ? ? ? ? ? ?window.open('http://idcbgp.cn','_blank','width=400,heigh=500,menubar=no,toolbar=no')
? ? ? ? ? }
? ? ? }
? ? ? else
? ? ? {
? ? ? ? ? document.wirte("不打開");
? ? ? }
? }
? ??
? </script>?
?</head>?
?<body>?
? <input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2019-01-17
。。?;卮疬@個(gè)問題的時(shí)候我非常糾結(jié),我想把你按地上打死,又很想感謝你。
首先,先解決問題。您write這個(gè)單詞拼錯(cuò)了?。。。。?/p>
另外一開始我沒注意這個(gè)拼寫錯(cuò)誤,所以花了1個(gè)小時(shí)學(xué)習(xí)了document.write這個(gè)函數(shù),非常有意思。建議可以查查