Solved

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

Posted on 2011-09-19
6
539 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

749 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