mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-05-14 09:33:09 +00:00
small refactor for clean
This commit is contained in:
parent
f555a27e34
commit
1911dba7d7
1 changed files with 3 additions and 2 deletions
|
|
@ -47,9 +47,10 @@
|
|||
|
||||
//return a url path with the window's location protocol/hostname removed
|
||||
clean: function( url ){
|
||||
// Replace the protocol and host only once at the beginning of the path to avoid
|
||||
// Replace the protocol and host only once at the beginning of the url to avoid
|
||||
// problems when it's included as a part of a param
|
||||
return url.replace(new RegExp("^" + location.protocol + "//" + location.host), "");
|
||||
var leadingUrlRootRegex = new RegExp("^" + location.protocol + "//" + location.host);
|
||||
return url.replace(leadingUrlRootRegex, "");
|
||||
},
|
||||
|
||||
//just return the url without an initial #
|
||||
|
|
|
|||
Loading…
Reference in a new issue