Created
May 20, 2013 17:21
-
-
Save ispedals/5613710 to your computer and use it in GitHub Desktop.
JSONP Test
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
<!doctype html> | |
<html lang=en> | |
<head> | |
<meta charset=utf-8> | |
<title>JSONP Test</title> | |
<script> | |
function foo(data) { | |
document.getElementsByTagName('body')[0].innerHTML=JSON.stringify(data); | |
} | |
var script = document.createElement('script'); | |
script.src = 'http://www.reddit.com/r/pics/.json?jsonp=foo'; | |
document.getElementsByTagName('head')[0].appendChild(script); | |
</script> | |
</head> | |
<body> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment