I have a single json encoded array set in an ajax call:
$var = json_encode($_SESSION['pictures']);
I put this json encoded array in a var called "array" When I alert the var array, I receive the following callback:
["http://linktoimage1", "http://linktoimage2"]
now I want to output the first value through a jquery call:
$('#imgswap').attr('src', array[0]);
When I make this jquery call, I receive the value "[". If I change it to array[2], I receive "h". So he's giving me back characters instead of the complete values of the array.
What am I doing wrong?