Unable to retrieve 'location' property value of google.search.NewsSearch result

3 views
Skip to first unread message

Ashwani

unread,
Nov 10, 2009, 12:24:49 AM11/10/09
to Google AJAX APIs
Hi All,

The API doc says that .location property of the NewsSearch result
contains the location of the news story. But I'm not getting any value
in it. I'm doing like this:

var results = newsSearch.results;
for (var i = 0; i < results.length; i++) {
var result = results[i];

alert("loc " + result.location);
var loc = document.createElement('td');
loc.appendChild(document.createTextNode(result.location));
container.appendChild(loc);

}

Is it a bug or I'm doing something wrong? Please can someone help.

thanks & Regards,
Ashwani

Jeff S (Google)

unread,
Nov 11, 2009, 1:40:17 PM11/11/09
to Google AJAX APIs
Hi Ashwani,

I think that what you are seeing is expected behavior. For some
stories we do not have location information, so it is left blank in
the JSON result data.

Happy coding,

Jeff
Reply all
Reply to author
Forward
0 new messages