Hello to all. Tell me, please, otherwise I haven't been able to find anything for a week. Need an asynchronous page loading script. For example, when the page of the site was fully opened, the inscription "Подождите идет загрузка" , and after 2 - 3 seconds the site content appeared (in my cases these are blogs).

  • jquery you do not want? - Chad

2 answers 2

Here is a simple solution - popup with self-closing. Now he is of course extremely primitive, just as an option:

 <style> * { margin: 0; padding: 0; } #popup { position: absolute; background: red; width: 100%; height: 100%; z-index: 100; } </style> <script src="jquery-1.9.1.js"></script> <script> $(function() { $( 'body' ).prepend( '<div id="popup">Downloading... please wait!</div>' ); setTimeout(function() { $( '#popup' ).remove(); }, 3000); }); </script> 

You can make the closure not on a fixed time but on onload , when the content is uploaded.

  • Wrong decision, you need to do it not in three seconds but after the html page is fully loaded. And then suddenly someone can have an Internet brake - bemulima
  • I am in js zero so could you prescribe YOUIX html and I don’t know what to do with it - mayrbek
  • hashcode.ru/users/7998/bemulima why not right ??! As the author wrote, you can hang on onload and that's it !! - Cone

Using jQuery, try loading a text stating that the page is loading on a loading event. And when the page loads, display the content.