Please wait while data is loading?

Fait

Seasoned Veteran
Joined
Oct 15, 2010
Messages
4,407
Reaction score
561
FP$
2,054
Once again sorry for asking alot of question but as they say "Don't be afraid to ask any question its how you learn"

Anyway,

I am trying to get A message to say 'please wait' while the new data is loading or the scripts are executing.

How can I add this to any jquery script?

Thanks,


Spudster
 
Its easy, make the div which has/would have data hidden.... Another div which has message... Now after doing stuff or loading data, hide the loading div and show the div which contains data...

See the code below :-
Code:
<style type="text/css">
#data {
display: none;
}
</style>
<div id="load">loading...</div>
<div id="data"></div> 
<script type="text/javascript">
$('#data').load(<url-here>, function() {
$('#load').hide();
$('#data').show();
});
</script>
 
Thanks :.)

Thought it be something simple.

Now I have another issue that I am trying to solve I think JQuery is alot harder then PHP was to learn lol but I will get there if I can learn dedication which I have now.

Anyway,

Heres the HTML Form

Code:
<html>						
		<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
		<script src="js/login.js"></script>
		<div id="content"> </div>
	<input type='text' name='user_login' id='user_login' placeholder='eg: [email protected]'> <br>
			<input type='password' name='pass_login'> <br>
			<input type='submit' name='submit_form' id='submit' value='Login'> 
			</html>




JQuery/Javascript, I have tried the .load and $ajax requests ethier of them seem to work.


Code:
$(document).ready(function() {

$('#submit').click(function() {


//load won't work also tried serialzing it.
$('#content').load('ajax/check.php');

});

});


Thanks :.)

With some help on how to use them in PHP Forms I should get there.

Yes I know that Java Script is Client Side and PHP Is Server side which makes it abit more harder.
 
I assume you are trying to submit form using ajax.... First a couple of things in the mark : The input tags should be inside the form tags and the script tags must have type="text/javascript" attribute to work properly in IE..

Now what error does the script throw? Wait, How do you run the script? From localhost?
 
I make those changes in the script now, IE is the worst browser lol.

Ans yes I am using my local machine, Using WAMP Server.

Since its JS it doesent output no errors except when it connects to the PHP page it does output.

Code:
( ! ) Notice: Undefined index: user_login in E:\wamp\www\development_site\login\ajax\checak.php on line 3

So I think its not picking up the $_POSTsince they are both different languages but I have seen it done, Figuring it out how.
 
The issue is that the index user_login(name of an input) is undefined in $_POST, which means the data is not submitted to server side... .load wont submit a form or create an ajax request, it simply sends a get request to passed url that is simply loads the url...
 
Would you know the way to get it to exucute the php script instead of just loading the url.

It would help.
 
See the reply in this thread, i have replied how to make a simple login without page refresh : http://forumpromotion.net/viewtopic.php?f=54&t=102924

Spudster said:
Since its JS it doesent output no errors
You can see errors thrown by javascript if you have a browser that has developer tools like fro eg, if you have google chrome right click and select inspect element in context menu...
 
Back
Top Bottom