I\'m having some issues with ajax and codeigniter. I\'ve already posted another question (link to question) and I thought I solved it, but I did not so I`m asking someone to wri
use site_url()
of codeigniter
function increase(){
var number = parseInt($('#number').html()) + 1;
$.ajax({
type: 'POST',
url: '',
data: { increse:number }, //<--- here should be increase
success:function(response){
$('#number').html(response);
}
});
}
however, adding http://
in front of localhost should work
url: 'http://localhost/test/welcome/increase',
but it is always better and recommended to use site_url()
if you are calling a controller in CI...so that this won't give you errors while when you upload it to live server.