AJAX

Moderators: None (Apply to moderate this forum)
Number of threads: 61
Number of posts: 110

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Ajax reloads my page Posted by Tempestas_Ludi on 2 Feb 2012 at 9:09 AM
Hy everybody,
I'm making a website with html, javascript, jquery, and ajax techniques.
But when i'm sending an ajax request the page reloads!
Does anyone know why that is?
this is my ajax code:
$(document).ready(function(){
$("form").submit(function(){
	$.ajax({
		type:"POST",
		url:"ajax.php",
		data:"a="+$("#a").val()+"&distance="+$("#b").val()+"&c="+$("#c").val(),
		success: function(r){$("#result_wrapper").html(r)},
		error: function(){alert("error")}
	})
});
});


Tempestas Ludi.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.