1
I’m new with MVC development and so far I’m having difficulty identifying the error when trying to save the records of my form. Give error message: 403 (Forbidden). I am using Codeigniter.
My job:
$(document).ready(function () {
$('#btn-save').click(function () {
var dados = $('#form').serialize();
$.ajax({
type: 'POST',
dataType: 'json',
url: "<?php echo base_url('index.php/centros/cadastrar');?>",
async: true,
data: dados,
success: function (response) {
location.reload();
}
});
return false;
});
});
});
You notice you have
});
more code? is just like that or was it just copy/This is where it came in?– Sergio
Where does this error occur? on the console? If you do
location.reload();
in the success of ajax why not do a simple POST without AJAX?– Sergio