cusspvz
cusspvz

Reputation: 5281

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 isn'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

Upvotes: 1

Views: 148

Answers (2)

Daniel Vassallo
Daniel Vassallo

Reputation: 344291

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):

Upvotes: 6

PJP
PJP

Reputation: 766

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.

Upvotes: 2

Related Questions