PM 2Ring wrote:
My Google-fu is failing me.
, I'd be most grateful.
are used to get around this limitation, but the web server/script has to be set up to handle JSONP requests. I dont know if the XKCD scripts are set up to handle JSONP, unfortunately.
If you just want to fetch something from another server for the purpose of testing, try something like Twitter or Flickr. They both have public APIs with JSONP functionality.
If you want the XKCD data specifically, try running it through this Yahoo Pipe. Yahoo Pipes take in data from various sources (JSON, XML, RSS, HTML, ETC), gather, format, sort, filter them, and then output them in the requested format. They are kinda cool. There is a pipe that allows you to grab any JSON feed and turn it in to a JSONP request. For example:http://pipes.yahoo.com/pipes/pipe.run?_id=29053b7ff74d5086a97cb14ad3ba0aba&_render=json&url=http%3A%2F%2Fxkcd.com%2Finfo.0.json&_callback=jsonp_callback
Note the paramaters. _id is the pipe id. _render is the format (json, xml, rss, etc)._callback is the paramater you would be interested in most. By supplying jsonp_callback here, the output of the pipe is sent to the jsonp_callback function when it all loads.