diff --git a/js/jquery.mobile.navigation.js b/js/jquery.mobile.navigation.js index 7037f805..8260fe0a 100644 --- a/js/jquery.mobile.navigation.js +++ b/js/jquery.mobile.navigation.js @@ -48,9 +48,9 @@ if(path.isQuery( url )){ // if the path is a list of query params and the hash is a path - // append the query params to it. otherwise use the pathname and append - // the query params - return ( isHashPath ? path.stripHash( hash ) : location.pathname ) + url; + // append the query params to the paramless version of it. + // otherwise use the pathname and append the query params + return ( isHashPath ? path.cleanHash( hash ) : location.pathname ) + url; } // otherwise use the hash as the path prefix with the file and @@ -82,6 +82,14 @@ return url.replace( /^#/, "" ); }, + stripQuery: function( url ){ + return url.replace( /\?.*/, ""); + }, + + cleanHash: function( url ){ + return path.stripHash( path.stripQuery ( url )); + }, + //check whether a url is referencing the same domain, or an external domain or different protocol //could be mailto, etc isExternal: function( url ){