Drop-in file reloader, vanilla JS.
Watch a set of URLs and reload the page when one changes.
See index.html or
<body>
<script type="text/javascript" src="tiny-reload.js"></script>
<script type="text/javascript">
tinyReload([
'tiny-reload.js',
'index.html',
]);
</script>
</body>
The tinyReload
function accepts 3 arguments:
- An array, listing all the URLs you want to watch.
- An integer, the number of milliseconds between two fetch (optional, default to
10000
). - A boolean, whether you want to display the errors or not (optional, default to
false
).