Why isn’t the following working, inside a loop it never prints the url when myJSON is empty or not.
$.each($.parseJSON(myJSON), function(key,value){
alert(value.url);
});
for this JSON structure:
[{"host":"foo","url":"bar"},{"host":"foos","url":"bars"}]
Edit: $.each is inside a loop which has instances/iterations where myJSON is empty if that makes a difference.
This works for me.