[Pkg-javascript-commits] [backbone] 111/281: Bugfix: replace hash should not append hash mark to javascript:0
Jonas Smedegaard
js at moszumanska.debian.org
Sat May 3 17:02:02 UTC 2014
This is an automated email from the git hooks/post-receive script.
js pushed a commit to tag 0.9.0
in repository backbone.
commit 1a06f9a21584673b468d410f53b599e1f53435ae
Author: Tim Harper <timcharper at gmail.com>
Date: Wed Nov 30 13:33:40 2011 -0700
Bugfix: replace hash should not append hash mark to javascript:0
It's invalid to do so. Instead it should replace the entire URL,
javascript:0 included.
This gets rid of a javascript error that was emitted in IE7 every time
navigate was used with replace: true
---
backbone.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/backbone.js b/backbone.js
index 10f0ca0..dabed49 100644
--- a/backbone.js
+++ b/backbone.js
@@ -853,7 +853,7 @@
// a new one to the browser history.
_updateHash: function(location, fragment, replace) {
if (replace) {
- location.replace(location.toString().replace(/#.*$/, '') + '#' + fragment);
+ location.replace(location.toString().replace(/(javascript:|#).*$/, "") + "#" + fragment);
} else {
location.hash = fragment;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/backbone.git
More information about the Pkg-javascript-commits
mailing list