Created
October 7, 2011 12:58
-
-
Save mahemoff/1270230 to your computer and use it in GitHub Desktop.
Basic Support for CoffeeScript JSONP calls
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
importScripts 'jsonp-worker.coffee' | |
jsonp 'http://api.twitter.com/1/followers/ids.json?cursor=-1&screen_name=ev&callback=?', (response) -> | |
# process response |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jsonp = (url, callback) -> | |
wrapper = "script#{Math.floor 1e16*Math.random()}" | |
self[wrapper] = callback | |
importScripts url.replace('=?', '='+wrapper) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment