【发布时间】:2014-04-04 02:42:21
【问题描述】:
我最近得出的结论是 $.inArray 不起作用。 我到处研究,看到与jQuery: why doesn't jQuery.inArray() work?类似的线程
但我仍然认为它是一个 jQuery 错误。 因为我有一个我在 $.inArray 中使用的 ARRAY
这是控制台日志
var testArray 值为:
["1", "15"]
这显然是 JavaScript 中的一个数组。
我正在使用命令
if($.inArray(14, testArray))
alert("14 should not be in array. Isn't it?");
我也试过以下,但还是同样的问题:
if(jQuery.inArray('14', testArray))
alert("14 should not be in array. Isn't it?");
【问题讨论】:
-
你忘了问问题..!
-
我也更新了。 :)
标签: javascript jquery