Url with parameters

  1. History.pushState()
    history.pushState(state, title, url): Add a record to the front of the browser history without refreshing .
    state(any) The data that needs to be saved. This data is saved on event.state when the popstate event is triggered .
    title(string) :
    Firefox currently ignores this parameter, although it may be used in the future. If you change this practice in the future, it should still be safe to send blank strings. In addition, you can send a short title to describe the state you want.

    There is no place to save this title so far, it is presumed to be the description of state?
    url(string) The url address that needs to be changed.
    ps: pushState requires at least two parameters.
    popstate: The event triggered when the browser clicks forward and backward. event.state can get the state set under the current url.
    In addition, getting the state set in pushState does not have to be obtained in the popstate event, you can also get it directly in history.state.

Demo
pjax, using ajax and pushState to make SPA consistent with multi-page application experience.
2. Obviously with ginseng

Guess you like

Origin blog.csdn.net/dandan2810/article/details/115018473