views:

165

answers:

2

I am consuming service of random.org, (I want to get the numbers from random.org site using url). I am fetching data using ajax from my JavaScript. So how to make cross domain ajax call from my domain (and avoid permission error)? I want solution without help of server side code (sever proxy). Example code will be great help for me.

+1  A: 

You need a server proxy on your domain, or it won't happen. Here's a summary of cross-domain ajax techniques, the only 'real' non-proxy solution, as RichieHindle pointed out, being jsonp. But that requires you to be buddies with the guys at random.org, or for them to have a compelling reason to enable it for you.

karim79
Is there any other way to overcome it ?
Silent Warrior
+5  A: 

Lobby the owner of random.org to provide a jsonp API - that's the only way to make this happen.

RichieHindle