Solved

Loading a Large Data through jquery! want to show Processing Please wait message

Posted on 2011-09-19
6
492 Views
Last Modified: 2012-05-12
It will be easier for fols of jquery because i am just a starter of jquery and i sometimes gets issues at simple places!

My question is i am getting the following data from jquery!

$.ajax({
type:"POST",
url:"welcome.php",
data: data,
success: function (html) {
$('#message').html(html);
}
});
return false;

Now my concern is the welcome.php page gives me a Data which takes around 1 min to load, actually it has a big view which takes time..

Now my Problem. I want to show a message to the user, when button clicked like this!

Please wait while we fetch data... and an revolving Image also in some red color

So once the data is load it should slowly fade out

Please guide

Thanks

0
Comment
  • 3
  • 2
6 Comments
 
LVL 6

Expert Comment

by:kswathi
ID: 36565022
0
 
LVL 15

Author Comment

by:Gurpreet Singh Randhawa
ID: 36565085
umm! i am still confused @ large. The links you gave me does not tell me how they will show image or loading message first when i make a call to the ajax welcome.php Page, it is retirning a whole html page with records already filled in!
0
 
LVL 20

Accepted Solution

by:
chaitu chaitu earned 500 total points
ID: 36565101

call the beforeSend and  complete functions in ajax call.

while page is loading apeend the progress.gif to the body.
$(document).ready(function () {


$("body").append('<div id="progressbar" style="display: none;"> <img src="loader_static.gif" alt="Please wait a moment"></div>');

});

$.ajax({
type:"POST",
url:"welcome.php",
data: data,
 beforeSend: function(){ $("#progressbar").show();},
 complete: function(){ $("#progressbar").hide();},
success: function (html) {
$('#message').html(html);
}

});

Open in new window

0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 15

Author Comment

by:Gurpreet Singh Randhawa
ID: 36565137
Thanks I will try and get back to you!

are you around for the next couple of hrs, i want this to finish it asap!
0
 
LVL 15

Author Comment

by:Gurpreet Singh Randhawa
ID: 36565222
is it necessary that i append to the body, can't i append the div to any specific table with specific ID so it should the div in that table rather than on body tag
0
 
LVL 20

Expert Comment

by:chaitu chaitu
ID: 36565237
some where in your form this should be defined like this.you are the best person to judeg where to define this..

<div id="progressbar"></div>
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now