-1

In my html code a lot of time leaves on loading of the script blocks.

While there is a loading on the screen of the browser nothing is displayed (white screen).

How can I make sure that when you start the browser would display any div block instantly (I want to make loading animation)

Michael Benjamin
  • 346,931
  • 104
  • 581
  • 701
Zhihar
  • 1,306
  • 1
  • 22
  • 45

2 Answers2

1

try this....

$(window).load(function() {
  $('#loading').hide();
});
WellJhim
  • 26
  • 2
  • no, no, no many script blocks first text text "first text" appears only a few seconds after the opening page – Zhihar Feb 27 '16 at 16:27
  • Welcome to Stack Overflow! While this code snippet may solve the question, [including an explanation](http://meta.stackexchange.com/questions/114762/explaining-entirely-code-based-answers) really helps to improve the quality of your post. Remember that you are answering the question for readers in the future, and those people might not know the reasons for your code suggestion. - [From review](https://stackoverflow.com/review/low-quality-posts/11430787) – Ferrybig Feb 27 '16 at 21:50
-1

You have a solution : http://www.w3schools.com/jsref/prop_doc_readystate.asp By this code, tou can see by javascript if your page is ready or not.

Put that in a script at the begininning of your html page, and put all the rest of your javascript in the end of the body tag (just before /body).

Keep me in touch if not solved !

Bertrand
  • 54
  • 1
  • 8