Removing hash from URL

后端 未结 5 870
忘了有多久
忘了有多久 2021-01-01 05:09

After removing hash from URL using window.location.hash=\'\' page getting reloaded in firefox.

EDIT

Example:

wwww

5条回答
  •  无人及你
    2021-01-01 05:31

    From https://developer.mozilla.org/en/DOM/window.location:

    Examples

    Whenever a property of the location object is modified, a document will be loaded using the URL as if window.location.assign() had been called with the modified URL.

    This question I think addresses what you want using jQuery:

    Change hash without reload in jQuery

    Other related questions:

    Change the URL in the browser without loading the new page using JavaScript

    How to remove the hash from window.location with JavaScript without page refresh?

    How can I change Firefox window.location.hash without creating a page reload?

提交回复
热议问题