?
Solved

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

Posted on 2011-09-19
6
Medium Priority
?
592 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
7 Extremely Useful Linux Commands for Beginners

Just getting started with Linux? Here's a quick start guide that has 7 commands that we believe will come in handy.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
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 count occurrences of each item in an array.
Suggested Courses

801 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