2

I'm creating a portfolio website for a filmmaker. I would like to know how to go to another page and change the URL when just scroll the window like these websites(http://taotajima.jp/, http://maxxhat.com/). Are these pages in one html document or multiple documents? I searched and tried to solve it by myself but couldn't find the answer since I'm a junior developer. I would like to know at least what I need to learn to actually do it. Thank you in advance.

Whezer
  • 101
  • 1
  • 7
  • Possible duplicate of [Silent load of new URL on scroll](https://stackoverflow.com/questions/43352118/silent-load-of-new-url-on-scroll) – ABC Apr 03 '19 at 06:01
  • 1
    They are in a single page, each time the website is scroll down you load in new content view a jQuery AJAX call and update the URL parameter or display new elements. They might also load a new page without refreshing also using AJAX. – ABC Apr 03 '19 at 06:01

1 Answers1

0

A new feature offers you a way to change the URL displayed in the browser* through javascript without reloading the page. It will also create a back-button event and you even have a state object you can interact with. You can programmatically invoke the back-function by running:

window.history.back();

If you need to manipulate a state (instead of creating a new one) you can use:

window.history.replaceState(“object or string”, “Title”, “/another-new-url”);

Check the example here LINK

Full Example is Found Here

AhmadMM
  • 371
  • 4
  • 16