Skip to content

Instantly share code, notes, and snippets.

@junpeitsuji
Created September 21, 2013 10:37
Show Gist options
  • Save junpeitsuji/6649301 to your computer and use it in GitHub Desktop.
Save junpeitsuji/6649301 to your computer and use it in GitHub Desktop.
// クロスドメインの http://hoge.com/test.cgi からJSONPを取得
var hoge = function(data) {
alert("key1:" + data.key1);
alert("key2:" + data.key2);
}
var script = document.createElement('script');
script.src = 'http://hoge.com/test.cgi?callback=hoge';
document.head.appendChild(script);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment