Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>what the first parameter in the pushState function is for? </p> </blockquote> <p>From <a href="https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history#The_pushState().C2.A0method" rel="noreferrer">the documentation</a></p> <blockquote> <p>state object — The state object is a JavaScript object which is associated with the new history entry created by pushState(). Whenever the user navigates to the new state, a popstate event is fired, and the state property of the event contains a copy of the history entry's state object.</p> </blockquote> <p>So it is a bundle of data of your choice that you get back when you return to that state.</p> <blockquote> <p>Right now the url in the addressbar changes successfully when I scroll through my page. How can I query the url/hash in the addressbar when I initially load the page.</p> </blockquote> <p>Look at the <code>location</code> object … but you don't need to. You can (and should) populate the page server side. This is one of the advantages of <code>pushState</code>, the link still works if JavaScript is not available and the server side fallback is smoothly integrated. </p> <blockquote> <p>How can I find out the last change in the addressbar when clicking the back button? </p> </blockquote> <p>You add an event listener (looking for a <code>popState</code> event), and the data you stored in it will be available on the event object. <a href="https://developer.mozilla.org/en/DOM/window.onpopstate" rel="noreferrer">MDN has an example</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload