views:

100

answers:

0

I have used the jQuery inArray function, but Eclipse tells me that this function is undefined. I don't understand how this can be so if it comes from the jQuery API.

preId is an integer, and queryPreds is an array.

Previously I was doing the if() statement a different way, which was tedious and prone to error but generally worked. I replaced the conditional part with $.inArray(preId, queryPreds) != -1 and my code broke, I don't understand why.

This is what I have now.

if($.inArray(preId, queryPreds) != -1){ 
  // code in here 
  }