Tomas Ramirez Sarduy
Tomas Ramirez Sarduy

Reputation: 17471

Null response using $.getJson() function

I have been trying to get a response from a server sending a GET URL, but isn't working for this particular server, on the other hand, when I put the same GET URL in the browser I obtain an answer. The server is in django python and I don't have access, because I'm currently programming the client side.

This is the javascript code:

var url = "https://www.mysite.com/module/get_requ/?user=ms&money_type=F&coin-count=1&pass=test&slots_id=12&line-value=9&slots_type=12&cacheBuster=1278933269465&coin-value=0.05";  
$.getJSON(url,  
        function(data){  
            alert(data);  
        });  

but when i do:

var url = "http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&format=jso&jsoncallback=?";

In the above code it work perfect. So, I want to know if i'm doing something wrong, or the problem is in the server side.

Upvotes: 0

Views: 307

Answers (1)

gilly3
gilly3

Reputation: 91487

This is most likely because of same origin policy. The flicker api uses JSONP, which is not subject to the SOP. So, unless bingocastle.co.uk also exposes a JSONP interface, you will not be able to request data from bingocastle.co.uk client side, without going through some server proxy.

Upvotes: 3

Related Questions