I have made this script that, if I have internet (checking with image) then it redirects, but it keeps images in cache, and if I have no internet then it still loads.
<img src="http://www.example.com/image.png"
onload="window.location='http://www.example.com/index.html';"
onerror="window.location='error.html';"
width="0px" height="0px"><br>Loading...
The problem is the cache, it caches the image and then when I reload without internet it still tries to load. Does anyone know another way to fix it?