1

I have some html/php pages with large amount of data. It takes few more extra seconds to load from the server. Is there any way to show "loader animation" for html pages/php pages using jquery? After completely loading the html/php page, the "loader animation" should be hide.

Thanks in advance

3 Answers 3

1

Sure.

Attach some javascript to the pages load event to a) show the 'Loading' animation b) kick off an ajax call to load the data and then c) clear the animation once finished.

Its pretty standard stuff - any AJAX tutorial will give you enough.

Sign up to request clarification or add additional context in comments.

Comments

1

You can use the AJAX functions as : ajaxStart() http://api.jquery.com/ajaxStart/ and ajaxStop() http://api.jquery.com/ajaxStop/

Comments

0

Simplest way :

You put a <div class="loader"></div> in head which loaded everytime on everypage, then create a function :

function hideLoad(){$('.loader').hide();}

and put onload in body tag as :

<body onload="hideLoad()">

that allow div to be showed up untill everything has been loaded.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.