Enquiry Email Form

If you want your jQuery to start executing after the page is fully loaded, you can use the following code:

1
2
3
4
5
<script type="text/javascript">
jQuery(window).on("load", function () {
// insert code here
});
</script>

I usually use this code for when I want animations http://topessayservice.org/ to start running or images to start fading in/out after the page has loaded, so users don’t miss the effect.

Just want to mention that the above code shouldn’t be confused with the following document ready event:

1
2
3
4
5
<script type="text/javascript">
$(document).ready(function() {
// insert code here
});
</script>

The document ready event executes when the HTML is loaded and the DOM is ready, even if all the images on your page haven’t loaded yet. The window load event executes later when the page is fully loaded, including all images and other objects.

Learning & sharing

This is where we store some of our Web Development thoughts, tips and tricks for both our own uses and for others to learn from. Sharing is caring.

Please feel free to contribute to our blog posts; perhaps even teach us a few tricks of your own. We'd love to hear your thoughts.



X