亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

求問這段代碼哪兒有問題

<!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://www.xianlaiwan.cn','_blank','height=600,width=400,top=100,left=0');}

? else

? {

? ? ? alert("233333")

? ? ? };

? ? }

? ??

</script>

</head>

<body>

? ? <input name="button" type="button" onClick="Wopen()" value="點擊我,打開新窗口!" / >

</body>

</html>



為啥我無論選確定還是取消 都直接彈出了?

我想要的是選 取消,就彈出23333

到底哪兒有問題啊?

正在回答

3 回答

if沒加括號呀

0 回復 有任何疑惑可以回復我~

童鞋,你if語句里的條件忘了加括號了。就是這個:?if xxxxx== true

加上括號就好了:if (xxxxx== true)

0 回復 有任何疑惑可以回復我~
if?(xxxxx?==?true)

話說這換行也太多了吧...

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

求問這段代碼哪兒有問題

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號