There is a workaround by using the history API on modern browsers with fallback on old ones:
if(history.pushState) {
history.pushState(null, null, '#myhash');
}
else {
location.hash="#myhash";
}
Credit goes to Lea Verou
More Related Contents:
- Scroll Automatically to the Bottom of the Page
- Trigger event when user scroll to specific element – with jQuery
- Parsing URL hash/fragment identifier with JavaScript
- How to scroll the window using JQuery $.scrollTo() function
- Highlight Menu Item when Scrolling Down to Section
- What is the best way to handle onchange event on a div? [closed]
- Different look in desktop, how to setup
- How to get client’s IP address using JavaScript?
- What’s the right way to decode a string that has special HTML entities in it? [duplicate]
- How to set file input value when dropping file on page? [duplicate]
- How can javascript upload a blob?
- Prevent BODY from scrolling when a modal is opened
- Why is it a bad practice to return generated HTML instead of JSON? Or is it?
- Equivalent of jQuery .hide() to set visibility: hidden
- JQuery .on() method with multiple event handlers to one selector
- Getting Bootstrap’s modal content from another page
- Run change event for select even when same option is reselected
- JQuery Slider, how to make “step” size change
- How to move table row in jQuery?
- prevent touchstart when swiping
- Load Image from javascript
- Remove attribute of HTML tag
- getElementById returning value only for first element [closed]
- Is there a way to zoom into a D3 force layout graph?
- How to find the indexes of all occurrences of an element in array?
- jQuery – bind event on Scroll Stop
- Twitter bootstrap – Focus on textarea inside a modal on click
- jQuery – get the first class only from a element
- Easy dom manipulation in AngularJS – click a button, then set focus to an input element
- How to select line of text in textarea