$(window).load doesn’t seem to be working in firefox

Tags: , ,



So I’ve got some code that need’s to be executed only when content of the website is loaded so I place it within window load, like this:

$(window).load(function() { 
   //some stuff happens
});

Works perfectly fine in safari and chrome (I’m on mac osx 10.8), however doesn’t seem to be working on firefox (19.0.2). Is there a fix or something that need’s to be applied in order to make firefox work with it?

It works if I clear cache in firefox, but doesn’t work any time after that.

Answer

did you try window.onload = function(){}



Source: stackoverflow