i have a json array
var a_values = new Array();
a_values["AF:All"] = new Array('KBL:Kabul','US:New york');
a_values["AL:All"] = new Array('TIA:Tirana');
How can i find , whether a given string is in a_values, using jquery
for example, i need to check whether ‘Kabul’ is there , in a_values
I think you’d like this a little better:
Then there are two ways of checking for existence of a string. One would be:
And another would be to loop through the array with a for loop, looking at each value.