Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

parse the hash to avoid decoding in FF, but use the location object e…

…lsewhere to avoid the inclusion of the auth
  • Loading branch information...
commit 3740d5e07d13d1d1f63a559e04102227bd165cc5 1 parent 74a8f48
@johnbender johnbender authored
Showing with 9 additions and 2 deletions.
  1. +9 −2 js/jquery.mobile.navigation.js
View
11 js/jquery.mobile.navigation.js
@@ -53,9 +53,16 @@ define( [
// browsers that auto decode it. All references to location.href should be
// replaced with a call to this method so that it can be dealt with properly here
getLocation: function( url ) {
- var uri = url ? this.parseUrl( url ) : this.parseUrl( location.href );
+ var uri = url ? this.parseUrl( url ) : location,
+ hash = this.parseUrl( url || location.href ).hash;
- return uri.protocol + "//" + uri.host + uri.pathname + uri.search + uri.hash;
+ // mimic the browser with an empty string when the hash is empty
+ hash = hash === "#" ? "" : hash;
+
+ // Make sure to parse the url or the location object for the hash because using location.hash
+ // is autodecoded in firefox, the rest of the url should be from the object (location unless
+ // we're testing) to avoid the inclusion of the authority
+ return uri.protocol + "//" + uri.host + uri.pathname + uri.search + hash;
},
parseLocation: function() {
Please sign in to comment.
Something went wrong with that request. Please try again.