this is my ajax script which i used in codeigniter to send form data without page refresh now i want to know how can i submit form in cakephp 2x using ajax.. i dont want to use cakephp helper or other difficult methods which i find difficult ... please do some changes in this script or if is possible to send data through changes of this script little bit because i find this easy ...
$('#submit').click(function() {
form = $("#form").serialize();
$.ajax({
type: "POST",
url: "<?php echo site_url('categoryController/addCategory'); ?>",
data: form,
success: function(data){
$(".success").fadeIn(500).delay(2000).fadeOut(500);
$("#form")[0].reset();
}
});
event.preventDefault();
return false;
});