I have this code:
$("a.ajax").on('click', function() {
ajax_link();
});
function ajax_link() {
$('#ajax_load').remove(); // Remove js
$('#section').html('<?php echo $this->ajax_loading; ?>');
setInterval( function() {
$('#section').load($(this).attr('href')+'&ajax=true');
return false;
}, 1000);
}
But when I click the link it reloads the page instead of loading the content. Does anyone know why?
I added the rest of the code to make sure its not that.