Live Search API troubleshooting tips
24 March 2009
I tried to add the Microsoft Live Search API 2.0 to my site and ran into a couple of problems.
I used the JSON sample at \Live Search API 2.0 SDK\Samples\JSON\WebSample.html
the sample worked fine as is, but when I added a site:mysite.com like this on line 21
it stopped returning any results, even though the same query on search.live.com works.
After playing around for a while, I figured out I had to remove
and while I was at it, I also removed:
now the searches worked.
The second problem was when they were really no search results, I got a
results is undefined
(response.SearchResponse.Web.Offset + results.length)
on line: 84
To fix this, I added some code around the results display:
if (response.SearchResponse.Web.Results == null)
resultsHeader.innerHTML = "No results found";
// display results