JavaScript - Create a loading bar : <p>I'm trying to create a loading bar, that I'll use when I'll open links or images. I mean, while the page/image isn't loaded yet, a would like to show a loading bar like the one I shown you.<br>
I know how to create the bar in fact, but I don't know how to get the status of the load of the page/image. I imagine that I need to use JavaScript or jQuery, but if you know any way to do this in PHP it would help me.</p>

<p><a href="https://i.stack.imgur.com/51I95.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/51I95.jpg" alt="Loading Bar"></a></p>

<p>Thanks!</p>
