My json text is of the form ["string1" , "string2", ...].
How do I convert this to a javascript array and display the values?
My json text is of the form ["string1" , "string2", ...].
How do I convert this to a javascript array and display the values?
Using JSON library https://raw.github.com/douglascrockford/JSON-js/master/json2.js
var array = JSON.parse('["string1" , "string2", "string3"]');
Or using jQuery
var array = $.parseJSON('["string1" , "string2", "string3"]');
Or using eval ( Not recommended )
var array = eval('["string1" , "string2", "string3"]');
Then array[0] , array[1] ...