I have a webpage that reloads some data using a jquery post every 30 seconds, the jquery post will retrieve the anchors in tab form, so when jquery updates, the binding is always placed on the first binding.
Say I have # anchor1, # anchor2 and # anchor3. If the user is viewing # anchor2 and jquery reloads, the default is # anchor1. Before executing jquery, I check which anchor is used by the observer, and then after completing jquery, I select the anchor they are looking at using the code below
document.location.href= "#anchor2";
When I use the above code, it explicitly forces the page to refresh, so it performs the initial function document.ready to retrieve the data, so the timer is never used, instead, it constantly reloads jquery, doing this every second or so, instead of using the javascript timer.
How can I direct the user to the anchor that the user viewed before the ajax reload without causing the page to refresh.
Thanks for any help you can provide.
source
share