Change location.hash and then press Back button - IE behaves differently from other browsers

后端 未结 1 723
忘掉有多难
忘掉有多难 2021-01-16 04:25

I change location.hash - in all browsers this behave properly - the page remains original and changes only URL without reload the page.

Pressing Back bu

1条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-16 05:30

    (Moving my comment here and expanding on it a little.)

    There are several other questions regarding the #hashtag history quirks with IE.

    Essentially, IE doesn't treat different #hashtags as separate entries in its History object.

    The best solution appears to be the jQuery History Plugin.

    Note- jquery history is no longer maintained and the former maintainers recommend Jquery hashchange

    0 讨论(0)
提交回复
热议问题