How to stop my title from "reloading" when I click on another page?

I am a relatively new web designer. I have a question that I can’t understand as a phrase, that I was hoping I could help! I am wondering how I can do this, so the title does not “reload” when users click on another page on my site. A good example is on the Invisible Creature website (here, in particular, http://www.invisiblecreature.com/#/work/all/hexapillar ). When you click on different links, the title remains loaded (it does not "turn white", as on most sites). Sorry if this is a little embarrassing - it's hard for me to transfer thoughts to words. Thanks!!: -)

+4
source share
1 answer
  • Design your site so that it works fine (including reloading shared content)
  • Set up a part of the site on the server side so that you can request a regular page or, with a changed URI, only the content.
  • Using JavaScript, configure event handlers so that when you activate a link, you check to see if it is on another page of your site or elsewhere.
  • If this is a page on your site: preventDefault , then use XMLHttpRequest to retrieve the contents of the page and the DOM to replace the section of the page contents with new content
  • Use pushState to change the URL of the URL that the link would go to
  • Set up a popstate event handler to display the desired content when the user clicks Back.

Make sure you use function detection to return to regular links if your browser does not support any of XHR, pushState, etc.

+2
source

Source: https://habr.com/ru/post/1439655/


All Articles