I have a link:
<h2><a href=?p=article&aid='.$article->id.'" onclick="loadPage('article'); return false;">.$article->title.</a></h2>
and it calls this function:
function loadPage(page){
$("#content").html("Loading...");
$.post("page.php", {p: page}, function(data){
$("#content").html(data);
});
}
But after my javascript has been ran the href is still active.
I’ve used return false; on my onClick’s before to prevent this but it’s not working this time????
It looks like your script has an error and is not reaching the return block. If you add the try catch, it will ignore the errors in the script.