开发者

Error while using Yahoo PlaceFinder API and jQuery in json format

I'm implementing some Yahoo API in one of my projects. I was using the Yahoo GeoPlanet in json format with jQuery and went really smooth. However I cannot get working the Yahoo PlaceFinder API with jQuery in json format.

When I do the request with the $.getJSON function I get the following message:

XMLHttpRequest cannot load http://where.yahooapis.com/geocode?q=Vancouver&flags=J&count=10&lang=en&appid=MYKEY. Origin "http://yrm" is not allowed by Access-Control-Allow-Origin.

Where "http://yrm" is my localhost servername for that project.

Below you'll find the code I'm using:

var url = 'http://where.yahooapis.com/geocode?q=Vancouver&开发者_开发技巧amp;flags=J&count=10&lang=en&appid=' + yahooApiKey;

$.getJSON(url, function(data){
    console.dir(data);
});

The console.dir only prints NULL in the console.

Any idea on what can I do?

Thanks in advance!


add

&callback=?

at the end of the url string

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜