PDA

View Full Version : Javascript Version of PHP in_array()


TalkHardRandy
02-26-2003, 11:38 PM
Title says it all...

I love the PHP in_array() and use it quite a bit. But in order to get my my code to display in a template, I need to get that same functionality in JavaScript, but I don't think such a function exists...

Esentially, I'm generating a table with numbers in it. If the cell number is in an array, it changes the background of the table. Works great it PHP, but I have no idea how to do it in JavaScript.

Any ideas?

TalkHardRandy
02-27-2003, 09:57 PM
UPDATE:

I didn't find it... what I ended up doing is a bunch of OR statements, which is really messy, but end users wont' be looking at the code...