Thanks José M. Pérez for such a wonderful explanation. Basically I wanted to reduce the document completion or window.load time. So I can fire an Ajax or run code after the page is fully loaded.

Your blog was very useful as I got window.load event free much early as compared to other two techniques. Now I can also work on other page load parameters as suggested by you.

Thanks again for response!! Much appreciated :)

Ruby On Rails Developer, JavaScript Lead, Quick Learner, Reader, Writer, Always in Mood !!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store