Skip to content

Instantly share code, notes, and snippets.

@kenmazaika
Created April 23, 2018 03:25
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 kenmazaika/b7e9d0da3ffe256c986fd28fed035af2 to your computer and use it in GitHub Desktop.
Save kenmazaika/b7e9d0da3ffe256c986fd28fed035af2 to your computer and use it in GitHub Desktop.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<h1 id="headline">Hi Karla</h1>
<button id="btn">Click me!!!</button>
<script>
// var movieName = "Sharknado";
// var apiKey = "4ce5edcc";
// var queryURL = "http://www.omdbapi.com/?t=" + movieName + "&apikey=" + apiKey;
// $.ajax({
// url: queryURL,
// method: "GET"
// }).done(function(response) {
// var actors = response.Actors;
// $('#headline').text(actors);
// });
$('#btn').click(function() {
var movieName = "Sharknado";
var apiKey = "4ce5edcc";
var queryURL = "http://www.omdbapi.com/?t=" + movieName + "&apikey=" + apiKey;
$.ajax({
url: queryURL,
method: "GET"
}).done(function(response) {
var actors = response.Actors;
$('#headline').text(actors);
});
// console.log("hi");
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment