When I use JSON data obtained by:
$.getJSON("http://192.168.1.9:8983/solr/db/select/?wt=json&&start=0&rows=100&q="+elegant+"&hl=true&hl.fl=description&hl.usePhraseHighlighter=true&json.wrf=?", function(newresult){
and use this JSON data as:
$.each(newresult.highlighting, function(i, hitem){
alert(hitem.description[0]);
});
then I am not getting the description field value.
But when I assign whole data in a variable, say newresult and then run $.each() it is working, as I did in http://jsfiddle.net/taL8x/1/. Please tell me what is the problem when I use data through getJSON().
If passing line at
alert, newresult.highlighting should be object or array. then, this is not a problem about Same Origin Policy. And you are specifyingjson.wrf=?for callback.Probably, you missed about struct of element in highlighting array. maybe.
Try to access directry, and confirm structure of the array.
You are expecting:
But it may be