Created
October 28, 2014 00:19
-
-
Save katherineschultz/58283d5ce5b0c2e6bd1b to your computer and use it in GitHub Desktop.
// source http://jsbin.com/vakof
This file contains hidden or 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> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<div id="events"> | |
Events | |
</div> | |
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script> | |
<script> | |
//the assignment: | |
//Create a new div with the id "events" | |
//Create a new function in your javascript that calls Meetup open events method | |
//Get events using the zip parameter | |
//Don't forget to send your key as a parameter | |
//Add a parameter such as topic to find meetups that you would be interested in | |
//Look at the results in the console.log() like this: console.log(data); | |
//call this new function in document ready | |
//the magic ajax function: | |
$.ajax({ | |
url: 'https://api.meetup.com/2/open_events' | |
data: { | |
parameter: "zip", //all parameters have commas after them | |
parameter: "topic", | |
parameter: "key = 7f793f657c26806857c293d2a247526", | |
}, | |
crossDomain: true, | |
dataType: 'jsonp', | |
type: "GET", | |
success: function (data) { | |
console.log(data); | |
}, | |
error: function(data) { | |
console.log("NOPE!"); | |
} | |
$(document).ready(); | |
}); | |
function zipCode(){ | |
alert (data); | |
} | |
$(document).ready(zipCode); | |
</script> | |
<script id="jsbin-source-html" type="text/html"><!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<div id="events"> | |
Events | |
</div> | |
<script src="https://code.jquery.com/jquery-2.1.1.min.js"><\/script> | |
<script> | |
//the assignment: | |
//Create a new div with the id "events" | |
//Create a new function in your javascript that calls Meetup open events method | |
//Get events using the zip parameter | |
//Don't forget to send your key as a parameter | |
//Add a parameter such as topic to find meetups that you would be interested in | |
//Look at the results in the console.log() like this: console.log(data); | |
//call this new function in document ready | |
//the magic ajax function: | |
$.ajax({ | |
url: 'https://api.meetup.com/2/open_events' | |
data: { | |
parameter: "zip", //all parameters have commas after them | |
parameter: "topic", | |
parameter: "key = 7f793f657c26806857c293d2a247526", | |
}, | |
crossDomain: true, | |
dataType: 'jsonp', | |
type: "GET", | |
success: function (data) { | |
console.log(data); | |
}, | |
error: function(data) { | |
console.log("NOPE!"); | |
} | |
$(document).ready(); | |
}); | |
function zipCode(){ | |
alert (data); | |
} | |
$(document).ready(zipCode); | |
<\/script> | |
</body> | |
</html> | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment