Skip to content

Instantly share code, notes, and snippets.

@katherineschultz
Created October 28, 2014 00:46
Show Gist options
  • Save katherineschultz/b02c910151f2b12be1d6 to your computer and use it in GitHub Desktop.
Save katherineschultz/b02c910151f2b12be1d6 to your computer and use it in GitHub Desktop.
<!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: {
zip: "60647", //all parameters have commas after them
status: "upcoming",
key: "7f793f657c26806857c293d2a247526",
},
crossDomain: true,
dataType: "jsonp",
type: "GET",
success: function (data) {
console.log(data);
},
error: function (data) {
console.log("NOPE!");
}
});
$(document).ready(function(){
});
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: {
zip: "60647", //all parameters have commas after them
status: "upcoming",
key: "7f793f657c26806857c293d2a247526",
},
crossDomain: true,
dataType: "jsonp",
type: "GET",
success: function (data) {
console.log(data);
},
error: function (data) {
console.log("NOPE!");
}
});
$(document).ready(function(){
});
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