Skip to content

Instantly share code, notes, and snippets.

@mariohmol
Last active July 2, 2016 02:55
Show Gist options
  • Save mariohmol/29d90efd35b947de8f6df79600ea6b24 to your computer and use it in GitHub Desktop.
Save mariohmol/29d90efd35b947de8f6df79600ea6b24 to your computer and use it in GitHub Desktop.
How to consume Coursera API using jquery - example with courses and jsonp workaround
<html><body>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.js"></script>
<script type="text/javascript">
$(function(){
$.ajax({
type: "GET",
url: "http://cors.io/",
data: {
u: "https://api.coursera.org/api/courses.v1?q=search&query=Philosophy"
}
}).done(function(d){console.log(d)});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment