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