3

I've been trying to debug something for over 8 hours, and in order to get a proper example to ask the question of why it's not working, I'm trying to put together a JSFiddle replica, but the AJAX request doesn't seem to make the call. Any help in finding out why would be greatly appreciated!

Link to JSFiddle: http://jsfiddle.net/cqpka/8/

I'm talking about the $.get() method.

animuson
  • 53,861
  • 28
  • 137
  • 147
Avicinnian
  • 1,822
  • 5
  • 37
  • 55

3 Answers3

3

And another problem might be

XMLHttpRequest cannot load http://www.offer-rotator.com/labs/json.php. Origin http://fiddle.jshell.net is not allowed by Access-Control-Allow-Origin.

You are not allowed to send remote ajax calls

Ergec
  • 11,608
  • 7
  • 52
  • 62
1

It looks like a same origin policy violation to call an external JSON file from jsfiddle. It would work correctly from the domain offer-rotator.com.

Michael Berkowski
  • 267,341
  • 46
  • 444
  • 390
0

Like others have stated, you are running into the cross origin policy limitiation which limits your ajax requests to inter domain requests. You have a few options, you could use JSONP or enable cors.

Community
  • 1
  • 1
aziz punjani
  • 25,586
  • 9
  • 47
  • 56