Practical Navigation with popstate and hashchange events

Поділитися
Вставка
  • Опубліковано 28 вер 2024
  • This tutorial explains how to use the popstate and hashchange events in conjunction with the history.state property and the history.pushState and history.replaceState methods to create simulated navigation for Single Page Applications.
    Code from video: gist.github.co...
    Video on pushState and replaceState:

КОМЕНТАРІ • 18

  • @_tanzil_
    @_tanzil_ Рік тому

    Yes that gave me really good understanding. I've been reading and watching other popular videos but couldn't understand because they don't explain just the way you do. Thanks with a sub ❤

  • @eip408
    @eip408 3 місяці тому

    This is awesome! Thanks Steve 🙌

  • @CodingNuggets
    @CodingNuggets 3 роки тому +5

    Steve, you deserve much more attention. Love your videos and they are so informative. Thanks. See you soon!

  • @GYOOREE
    @GYOOREE 3 роки тому +2

    Your lessons are so informative and helpful. Actually helps me a lot with my work! Many thanks from S.korea ☺️

  • @anil2009
    @anil2009 3 роки тому +1

    Sir, Do you know any NPM package which records video, apply filters to it ???

  • @qzbnyv
    @qzbnyv 3 роки тому +1

    Shame they’re cancelling The Expanse before the end of the story. I’ve only watched the first few episodes of the latest season, but man when Bobbie was being extra harsh on Alex it felt like she was really saying what she felt about Cas Anvar and his misdeeds in the real world.
    Looking forward to the remaining book/s though!

    • @cferdinandi
      @cferdinandi 3 роки тому +1

      Are you sure it was cancelled? My understanding was that Season 6 is already greenlighted (though it will be the final season). expanse.fandom.com/wiki/Season_6

    • @qzbnyv
      @qzbnyv 3 роки тому

      @@cferdinandi Yeah, cancelled before the end of the book story. But you're right about S6.

  • @cferdinandi
    @cferdinandi 3 роки тому +1

    I'm just here for the Expanse references!

    • @cferdinandi
      @cferdinandi 3 роки тому +1

      Just heard the bit about your dog dreaming in the background. Mine does the same thing to me when I'm recording!

  • @Chris2phaBrown
    @Chris2phaBrown 3 роки тому +1

    Great video, for an app I have planned I would also like to integrate loading the previous state when revisiting the site (maybe the next day). I have previously done this with cookies. What would you recommend? And how to integrate it with popstate and hashchange?

    • @Chris2phaBrown
      @Chris2phaBrown 3 роки тому +1

      Maybe setting the a cookie whenever pushstate is called, and also having a cookie check in the checkstate function?

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  3 роки тому +1

      @@Chris2phaBrown I would use localstorage or better indexedDB for saving state not cookies. The function being called by popstate and also by the init function is where that logic goes

    • @Chris2phaBrown
      @Chris2phaBrown 3 роки тому +1

      @@SteveGriffith-Prof3ssorSt3v3 Thanks for the reply mate, I'll look in to those. It's been quite a while since I had to implement it. sadly the site (a 3d vehicle configurator) isn't even live anymore :(

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  3 роки тому +2

      @@Chris2phaBrown I have some videos on indexedDB coming soon.

  • @singhvimlesh
    @singhvimlesh 2 роки тому

    Hi Steve can you make video that how can update props which came from redux will update when click on back button in browser.