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.

Silent Warrior
  • 5,069
  • 8
  • 41
  • 52

3 Answers3

7

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

RichieHindle
  • 272,464
  • 47
  • 358
  • 399
3

Just sent an email to random.org and received this reply

Thanks for your email. Yes, I am working on a JSONP interface.

Best regards,

Mads

Alexander
  • 23,432
  • 11
  • 63
  • 73
mplungjan
  • 169,008
  • 28
  • 173
  • 236
1

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
  • 339,989
  • 67
  • 413
  • 406