Executing js code after page load, ways
Come back
5

Executing js code after page load, ways

The easiest way that all newbies can think of is to specify the function in window.onload. Example:

Method with enStackOveflow ― launch via functions document.onreadystatechange and document.readyState. Example:

A fairly new way is to run through a handler DOMContentLoaded. Example:

A variation that will work for everyone using JQuery ― use JQuery :) . Example:

created:
10.07.2019
updated:
15.11.2022
author:
admin
Tags
If you have a problem in Prestashop
Or
yandex metrika