May 18, 2012

Javascript event after the dom is ready but not rendered

Question by rematnarab

Is it possible to do something after the dom is ready but it is not rendered(White screen)
I would like to hide the contents from user and after some operations i would like to show the final picture.
I could use “display:none” on my body tag but i am working on a huge project so i dont want to change every page.
Thanks

Answer by Starx

Here is how?

document.onload = fucntion() {
    //your codes
}

Unlike, window.onload this function runs after the DOM is loaded, so the manipulation is possible, but it does not require all the elements to be rendered.

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!