原因:“我不管點(diǎn)哪個(gè)提示按鈕,都執(zhí)行第一個(gè)if語(yǔ)句”<!DOCTYPE html><html>?<head>? <title> new document </title> ?? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> ??? <script type="text/javascript">? ? ?function Wopen(){? ? ? ? ? var str=confirm("你確定要打開(kāi)新窗口?");? ? if(str=true)? ? {? ? ? ? window.open('http://idcbgp.cn','_self','width=400,height=500,nenubar=no,status=no');? ? }? ? else if(str=false){? ? ? ? alert("你離開(kāi)了!");? ? }} ? ?? </script>??</head>??<body>? ?<input name="button" type="button" onClick="Wopen()" value="點(diǎn)擊我,打開(kāi)新窗口!" />?</body></html>
哪位大神幫我看看,這個(gè)代碼
qq_魚(yú)也缺氧_0
2017-03-25 16:23:38