July 20, 201016 yr Don't know if I dreamt this, but I'm sure I came across a bit of javascript code in the past which if put into a page, makes the page load the javascript first or something so that page loads correctly showing as it should. Does anyone know if that exists and if so what it is? Thanks
July 20, 201016 yr I think you're referring to a DOM Ready function, as opposed to a window onload function. The window.onload event fires once everything on the page has loaded, all the text, all the elements, all the images, everything. A DOM Ready function fires as soon as the structure of the page has loaded, but doesn't wait for any of the images. A good discussion (and a great example around comment 213) can be found on Dean Edward's blog
Create an account or sign in to comment