Created
December 5, 2024 21:06
-
-
Save sdubois/ee180aee9be01d42540e9cb8ad3f5bc4 to your computer and use it in GitHub Desktop.
Wix EruvStatus Image Example 2024
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 src="https://code.jquery.com/jquery-3.2.1.min.js"></script> | |
<style> | |
img {width: 300px;} | |
</style> | |
<p id="eruvstatus"></p> | |
<script> | |
var timestamp = new Date().getTime(); | |
$.getJSON(`https://eruvstat.us/eruv/98/json?_${timestamp}`, function(data) { | |
array = $.makeArray(data); | |
if(array[0]['field_status'] == "not checked"){ | |
var image = '<img src="https://static.wixstatic.com/media/8c16d0_fa05711047f74fbeb0e991dd42ed80ec~mv2.png"/>' | |
} | |
else if(array[0]['field_status'] == "up"){ | |
var image = '<img src="https://static.wixstatic.com/media/8c16d0_5aa0831373f4495eb4415da38cc46280~mv2.png"/>' | |
} | |
else if(array[0]['field_status'] == "down"){ | |
var image = '<img src="https://static.wixstatic.com/media/8c16d0_2a5b1b59f2fb48fc9e32be213fc5057f~mv2.png"/>' | |
} | |
$("#eruvstatus").html(image); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment