Skip to content

Instantly share code, notes, and snippets.

Created June 14, 2017 19:15
Show Gist options
  • Save anonymous/249bdfa36445d3df20acfbd06952e6a2 to your computer and use it in GitHub Desktop.
Save anonymous/249bdfa36445d3df20acfbd06952e6a2 to your computer and use it in GitHub Desktop.
art-bio-mu_open.html
<!DOCTYPE html>
<html>
<head lang="en">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="UTF-8">
<script src="https://code.jquery.com/jquery-1.11.3.js"></script>
</head>
<body>
<script type='text/javascript'>
var output;
var libhours = [];
$.getJSON("https://webservices.library.ucla.edu/calendar/hours/today/4691", function(arts) {
if (arts.locations[0].times.currently_open) {
libhours[0] = true;
}
}).done(function() {
$.getJSON("https://webservices.library.ucla.edu/calendar/hours/today/3291", function(biomed) {
if (biomed.locations[0].times.currently_open) {
libhours[1] = true;
}
}).done(function() {
$.getJSON("https://webservices.library.ucla.edu/calendar/hours/today/4698", function(music) {
if (music.locations[0].times.currently_open) {
libhours[2] = true;
}
}).done(function() {
if (libhours[0]) {
output = "Arts is open<br>";
}
if (libhours[1]) {
output += "Biomed is open<br>";
}
if (libhours[2]) {
output += "Music is open<br>";
}
document.getElementById("others").innerHTML = output;
});
});
});
</script>
<span id="others"><br><br> <img src="https://storage.googleapis.com/risemedialibrary-14d37739-5ebf-48da-9a52-4d8b63272675/Backgrounds/loader.gif" height="50" width="50"></img></span>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment