Adel Adel - 1 year ago 106
jQuery Question

jQuery (window).load() did not acces second time

I'm working on WordPress theme that has a preloading screen, this screen gets hide after entire page complete loading, and my code works perfectly for the past few months, but now the preloading screen did not get hide because the code did not access into (window).load() or window.onload = function ().

(function ($) {
window.onload = function () {

The result is "Start" even The page is complete download and the browser shows me entire page.

Info : I'm using WordPress 4.5 multi-website.


Answer Source

You have a function which Immediately executes termed as IIFE and have a window.onload handler in it.

There is no way window.onload handler will not invoke if it is inside IIFE

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download