How to stop page from jumping to the top onClick
First up, I'm really sorry if this has been asked before.
My question is, what do I need to do to stop a browser from jumping to the top of the page when a user clicks on a link which has a jquery function attached to it?
So for example
User clicks on a link called "Older Stories"
Once they do that, jquery will load in some content AJAX style
However, browser has jumped to the top of the page and we have to scroll back down again to see the content which has just been loaded in.
I've tried putting a return statement in my code but it didn't do anything
Here's my code
var content = $("#ajax_content");
$("#olderstories").click(function(){
showLoading();
//load content
content.load("olderstories.html", hideLoading);
});