Well, it looks like indexOf() (or probably better search()) is ok
since I just have to check a string for another one (e.g. is "2008"
contained in the date value).
(I didn't write the filter stuff yet...)
Hi Nicolas, I will definitely look into this, thank yout!
On 22 Feb., 13:34, Nicolas R wrote:
> Hey Thomas,
> from what you're saying it seems that we're trying to tackle the same
> issue. Have a look at this it may be
> helpful:http://groups.google.com/group/comp.lang.javascript/browse_threa
Hey Thomas,
from what you're saying it seems that we're trying to tackle the same
issue. Have a look at this it may be helpful:
http://groups.google.com/group/comp.lang.javascript/browse_thread/thread/83281987eccf68be
What's your solution?
On Feb 21, 4:24 pm, Thomas Jaggi wrote:
> Great, that's
Great, that's it. Thanks a lot!
The indexOf is just an example. The options are actually some kind of
filters and I want to check each item against each filter. Depending
on the filter It could be indexOf.
On 21 Feb., 14:44, Mike wrote:
> > What is "key"? That's not in either one of your dat
> What is "key"? That's not in either one of your data structs.
Oops, sorry, didn't look closely enough. But you can't use 'key' that
way. Try this:
if (item[key].indexOf(options[key]) != -1)
Not sure what you're after with the indexOf though.
> This doesn't work:
> $.getJSON("wheremydatais", function(data){
> $.each(data.items, function(i,item){
> $.each(options, function(key,val){
> if (item.key.indexOf(options.key) != -1) {
> console.log('everything ok');
Sorry, I mean "if (item.key.indexOf(val) != -1) {".
But anyway, any ideas? I know my approach probably makes no sense at
all...
8 matches
Mail list logo