Unstoppable Domains

Jquery ajax function not working?!

Spaceship Spaceship
Watch

PoorDoggie

Soon to be RICHdoggie!VIP Member
Impact
18
Hi there, I've got an email form on my website and this jquery code:

HTML:
$('#emailForm').submit(
			function(){
				var str = $(this).serialize();
				
				$.ajax({
	   				type: 'POST',
	   				url: 'email.php',
	   				data: str,
					sucess: function(msg){
						
						alert('Works');
				
						$('#note').ajaxComplete(
							function(event, request, settings){
						
								if(msg == 'OK')	{
									result = '<div class='notification_ok'>Your message has been sent. Thank you!</div>';
									$('#fields').hide();
								}
								else{
									result = msg;
								}
								
								$(this).html(result);
							}
						);
				
					}
				});
				return false;
			}
		);
When the form is submitted, I get an email through, so I know that the data is being sent to email.php, and is getting mail()ed to me perfectly fine. The problem is that the function being called under the "success: " bit isn't firing (as it were). So, even though it obviously works fine, connects to email.php and sends the email, its not displaying an alert, or changing the content of the #note div etc.

I can't find any problem here at all, its very strange. :(

Thanks
Tom

---------- Post added at 11:49 PM ---------- Previous post was at 10:48 PM ----------

just re-did it from scratch and it all seems to be working now... I don't know what I did the first time to make it stop working. lol

if anyone can see it I'd quite like to know thank you. :s
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99
Appraise.net

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Live Options
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back