I have a website with functionality of jquery for navigation. I use the load() function of jquery that enables the website to be navigated without refresh. But when I hit f5 for refresh for example I am in the Contact Us page it will hit back on the index page which is the parent page. Is there a way in jquery or ajax to focus on the page loaded when hitting refresh rather than redirecting it to the index.php page?
Share
The best way is to use some form of history navigation. pjax is a great plugin that allows you to use both real URLs and ajax loading functionality.
You could also implement it by simply changing
window.location.hashwhen you load new content. Then when the page is loaded, you could checkwindow.location.hashand load the relevant content.