I am pretty certain that Javascript is a bit overkill and a wee bit backwards (especially if using jQuery without the defer=""
attribute on the script) since it does take time for the javascript to get parsed and executed. Instead, use the decoding attribute set to async like so.
<img src="/path/to/file.jpg" decoding="async"></img>
Also, I am assuming that the most likely reason for why you want to lazyload images is to make your website load faster. If this is the case, then you can make your website load a huge amount even faster simply by converting your images to jpegs and compressing them with compressor.io/JPEGmini (upload your jpeg file to both and use whichever turns out smaller after compression).
Next, while full support in all browsers is not there yet, more and more browsers are starting to support it. I for one prefer to take the practical approach of making my websites full of the fast new features, and taking a backseat while my website grows faster with more supporting browsers, instead of spending vast amounts of time making my website load fast on old outdated browsers just to accommodate a small percentage of my users who really should update their browser more often.