Created
February 20, 2012 14:56
-
-
Save cdevroe/1869562 to your computer and use it in GitHub Desktop.
JSONP example for Viddler
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
<html> | |
<head> | |
<title>JSONP Example Using jQuery</title> | |
<script type="text/javascript" language="javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | |
<script type="text/javascript" language="javascript"> | |
function writeMsg(msg) | |
{ | |
if (window.console) { | |
console.log(msg); | |
} | |
else { | |
alert(msg); | |
} | |
} | |
function jsonViddlerAPI(json) | |
{ | |
writeMsg(json); | |
} | |
$('document').ready(function() | |
{ | |
$.ajax({ | |
dataType: 'jsonp', | |
url: 'http://api.viddler.com/api/v2/viddler.api.getInfo.jsonp?key=pf7nswvs6ctg10sz7pha', | |
}); | |
}); | |
</script> | |
</head> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment