search

Home  >  Q&A  >  body text

javascript - How to create a front-end effect similar to the sidebar on YouTube that is fixed but the URL changes?

In the sidebar on the left side of YouTube, when you click to switch the subscription channel, you notice that the sidebar is still fixed, but the url address bar has changed, which shows that this should not be achieved by relying on ajax.

In the current project, I don’t really want to use ajax to achieve such an effect, because it is not very conducive to users’ collection of web pages and seo, etc., but YouTube achieves URL changes that are conducive to users’ collection, and at the same time achieves similar results. How to achieve a good user experience with ajax? Could you please give me some general advice.

世界只因有你世界只因有你2725 days ago892

reply all(5)I'll reply

  • PHP中文网

    PHP中文网2017-06-12 09:30:05

    Modifying the url can be achieved through history.pushState. In addition, isn’t refresh-free ajax already very common?

    reply
    0
  • 我想大声告诉你

    我想大声告诉你2017-06-12 09:30:05

    Brother, don’t you know if people use Ajax by looking at the Internet? There is no Ajax data coming from the sky?
    In addition, modify the address bar URL. This is the pushState function of js.

    reply
    0
  • 给我你的怀抱

    给我你的怀抱2017-06-12 09:30:05

    Front-end routing can achieve such a function

    reply
    0
  • 怪我咯

    怪我咯2017-06-12 09:30:05

    like this?
    http://www.thepetedesign.com/...

    reply
    0
  • 高洛峰

    高洛峰2017-06-12 09:30:05

    pjax partial content update

    reply
    0
  • Cancelreply