English 中文(简体)
Javascript或堆积条件(如果& & 1美元($ 2 | | 3美元))
原标题:
  • 时间:2009-03-22 09:23:18
  •  标签:

为例。有三个变量,1是必须的,2和3是3 1和2可以是假的,只要是真的,2可以是假的,只要1和3是正确的。

if(xmlhttp.responseText.indexOf("type:SearchList~")>=0 && (obj == "hDrop" || obj == "iDrop")){
}

不为我工作

谁能发现问题?

最佳回答

我可以发现没有问题与您的脚本。这个非常简单的测试验证:

var a = "yes";
var b = "no2";
var c = true;
alert(c && (a == "yes" || b ==  no ));

检查obj的值。它是一个字符串?

问题回答

我做了一个真值表的条件:

1 2 3 R
-------
0 X X 0
1 0 0 0
1 1 X 1
1 X 1 1

这解决了1 & &(2 | | 3),所以别的东西是错误的。

You code is written correctly but it may be there are error in data you compare with so please trace the data and then check that it execute the condition correctly you can trace using alert(data);





相关问题
热门标签