Skip to content

Instantly share code, notes, and snippets.

@cdevroe
Created February 20, 2012 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdevroe/1869562 to your computer and use it in GitHub Desktop.
Save cdevroe/1869562 to your computer and use it in GitHub Desktop.
JSONP example for Viddler
<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