0

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.

3
  • 2
    Are the server and client code in the same domain? You cannot make a request to another domain due to the Same origin policy Commented Dec 24, 2011 at 4:19
  • looks like a simple typo ... you're passing 'url_flickr' to the getJSON command, but you set var url. (assuming it works for the second url you provide since that is a a flickr url ... is the code above a direct copy paste? Commented Dec 24, 2011 at 4:22
  • @chakram88, sorry about that, im passing url in the original code, i have the url and url_flickr vars in the original code. @Andrew Whitaker, i'm making the request from my computer Commented Dec 24, 2011 at 4:26

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.