Parsing of json array with jquery -


i have 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 find , whether given string in a_values, using jquery

for example, need check whether 'kabul' there , in a_values

i think you'd little better:

var abbreviations = new array(); abbreviations['af'] = new array(); abbreviations['af']['kbl'] = 'kabul'; abbreviations['af']['us'] = 'new york'; abbreviations['al'] = new array(); abbreviations['al']['tia'] = 'tirana'; 

then there 2 ways of checking existence of string. 1 be:

json.stringify(abbreviations).indexof('kabul') >= 0 

and loop through array loop, looking @ each value.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -