search

Home  >  Q&A  >  body text

javascript - http://www.XXXX.com/#/theme, what role does the # symbol play in such a path? Is there no refresh? Element locator?

It feels like the page is not refreshed when switching between different interfaces,
The rule displayed by the url address is /#/
I’m curious about what this rule does, no refresh? Or element locator?
伊谢尔伦伊谢尔伦2734 days ago732

reply all(4)I'll reply

  • PHP中文网

    PHP中文网2017-06-08 11:03:44

    "#" adds parameters to the url in the non-refresh state. You can add any parameters after #
    Commonly used in front-end, such as window.location.hash

    reply
    0
  • 習慣沉默

    習慣沉默2017-06-08 11:03:44

    Generally, single-page applications need to maintain a URL at all times, but they need to switch application status in different business scenarios. At this time, hash is used, which can switch status but will not refresh again. In addition, you can also refer to this article by Teacher Ruan Yifeng Let’s have a deeper understanding of this article about hash http://www.ruanyifeng.com/blo...

    reply
    0
  • 習慣沉默

    習慣沉默2017-06-08 11:03:44

    In the fragment definition of URL, the characters after # will not be sent to the server, but are used by the browser itself, so many js use the string after # as the URL in a single page.

    reply
    0
  • 三叔

    三叔2017-06-08 11:03:44

    First of all, # is followed by a large hash value. Although the page is not refreshed, the browser will record it so that you can move forward or backward, especially when making a single page, such as some router routing processing and detecting changes in the URL. window.location.hash

    reply
    0
  • Cancelreply