Last active
March 30, 2017 02:50
-
-
Save valokafor/34052c75ebd66fdd4bc2960aeca78647 to your computer and use it in GitHub Desktop.
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
<script> | |
function show() { | |
if(document.getElementById('benefits').style.display=='none') { | |
document.getElementById('benefits').style.display='block'; | |
} | |
return false; | |
} | |
function hide() { | |
if(document.getElementById('benefits').style.display=='block') { | |
document.getElementById('benefits').style.display='none'; | |
} | |
return false; | |
} | |
</script> | |
fetch(url) // Call the fetch function passing the url of the API as a parameter | |
.then(function() { | |
// Your code for handling the data you get from the API | |
}) | |
.catch(function() { | |
// This is where you run code if the server returns any errors | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment