-
-
Save pablovillaronga76/2fb06366eb6386f8613660300302b88b to your computer and use it in GitHub Desktop.
Client side code that processes the response from a demo Azure function
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
function processResponse(response) { | |
if (response.status === 200) { | |
output = | |
` | |
<div class="alert alert-success" role="alert"> | |
Hello, ${document.getElementById('name').value}! It's nice to meet you! | |
</div> | |
`; | |
document.getElementById('output').innerHTML = output; | |
} else { | |
output = | |
` | |
<div class="alert alert-danger" role="alert"> | |
Oh no! Something went wrong :( | |
</div> | |
`; | |
document.getElementById('output').innerHTML = output; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment