Fix #1649 - Set location.hash with a leading #.

This commit is contained in:
Brad Dunbar
2012-09-14 10:52:57 -04:00
parent 36a733a8bc
commit 7c993bd3fd

View File

@@ -1160,7 +1160,8 @@
if (replace) {
location.replace(location.href.replace(/(javascript:|#).*$/, '') + '#' + fragment);
} else {
location.hash = fragment;
// #1649 - Some browsers require that `hash` contains a leading #.
location.hash = '#' + fragment;
}
}