开发者

jQuery ajax is making connection, but the response is blank?

i'm trying to make a test with ajax response using an external array as a config file...

But it is开发者_如何学运维n't working, i'm getting always a blank response...

Can anyone point me the reason?

Here is the link of jsBin test: http://jsbin.com/udanu/2/edit


It looks like you have bumped into the Same Origin Policy. You cannot make Ajax requests to hosts outside your domain, unless you use JSONP, or some other technique to get around the policy.

You may want to check out the following Stack Overflow post for a few popular solutions to work around the SOP (mainly the JSONP, CORS and Reverse Proxy methods):

  • Ways to circumvent the same-origin policy


As you are trying to get data from another domain, maybe you should try using "jsonp" instead of "text" as a dataType.

EDIT: didn't see the previous answer.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜