[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2011-09-19
6
Medium Priority
?
644 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 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 2000 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

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 …
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses
Course of the Month19 days, 12 hours left to enroll

872 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