I am refreshing a div inside the web page with ajax call. But sometimes page is scrolling to top in chrome.
I think it is same issue: How do I stop a web page from scrolling to the top when a link is clicked that triggers JavaScript?
But putting return false
didn't resolve my problem. My code:
<span class="current" id="tab-kisiler"><a class="peoples" onclick="Refresh(); return false;">Refresh</a></span>
function Refresh() {
$.post('socket/get_online_users', {city: city}, function (data) {
$('#random_users').html(data);
});
}
How can I resolve this problem?