Solved

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

Posted on 2011-09-19
6
516 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 16

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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 16

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 16

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

825 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