How to set window.location to localhost including hash label in IE 8

I have a bookmarklet that is designed to change the current URL. The code:

javascript: location.href = 'http: // localhost: 8888 / # nominate'

However, in IE8, this ends up sending the browser to: http: // localhost: 8888 /

How to send IE8 to this hash search place?

Thank.

+5
source share
1 answer

Two attempts:

window.location = 'http://localhost:8888/#nominate';
window.location.assign('http://localhost:8888/#nominate');

The specification also allows you to directly set the window.location.hash value, but you do not need to do this.

+3
source

All Articles