-
-
Save Raynos/e911b554d0fb5e0709e1 to your computer and use it in GitHub Desktop.
This file contains 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
var querystring = require("querystring") | |
var uuid = require("uuid") | |
function jsonp(uri, options, cb) { | |
var script = document.createElement("script") | |
var id = uuid() | |
script.src = uri + "/?" + querystring.stringify(options) + | |
"&cb=__jsonp_"+id | |
window["__jsonp_" + id] = cb | |
document.body.appendChild(script) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment