-
-
Save stillio-support/9f796d43f4bf9cc92ac9c422ef845bec to your computer and use it in GitHub Desktop.
Embed latest screenshot in your webpage (see https://support.stillio.com/article/84-automatically-show-latest-screenshot-in-your-website)
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() { | |
| let stillioDivs = Array.from(document.querySelectorAll('div[data-stillio]')) | |
| stillioDivs.forEach((element) => { | |
| let imgSource = element.getAttribute('data-stillio') | |
| let imgTag = document.createElement('img') | |
| let utc = new Date().getTime(); | |
| let newSource = `${imgSource}?${utc}` | |
| imgTag.src = newSource | |
| imgTag.srcset = newSource | |
| imgTag.currentSrc = newSource | |
| element.appendChild(imgTag) | |
| }) | |
| })() | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment