求問(wèn)這段代碼哪兒有問(wèn)題
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>window.open</title>
<script type="text/javascript">
? function Wopen(){
? ? ? var xxxxx= confirm("would you like to open");
? ? ? if xxxxx== true
? ? ? {
? window.open('http://idcbgp.cn','_blank','height=600,width=400,top=100,left=0');}
? else
? {
? ? ? alert("233333")
? ? ? };
? ? }
? ??
</script>
</head>
<body>
? ? <input name="button" type="button" onClick="Wopen()" value="點(diǎn)擊我,打開新窗口!" / >
</body>
</html>
為啥我無(wú)論選確定還是取消 都直接彈出了?
我想要的是選 取消,就彈出23333
到底哪兒有問(wèn)題啊?
2015-05-31
if沒加括號(hào)呀
2015-04-07
童鞋,你if語(yǔ)句里的條件忘了加括號(hào)了。就是這個(gè):?if xxxxx== true
加上括號(hào)就好了:if (xxxxx== true)
2015-04-07
話說(shuō)這換行也太多了吧...