Class: LocationTools

locationTools~ LocationTools

Manipulate/parse the location bar of the browser

This is here because we have a couple of places where we want to remove query parameters from the location bar. This simplifies and helps us maintain DRY.

I call this LocationTools, because I do not want to call it simply Location, because that seems woefully prone to naming colission.


new LocationTools()

Source:

Methods


domain()

Return the domain (removes the subdomain from the domain) Note: this will not work if we ever use public suffixes such as co.uk If that is the case, we should use something like https://github.com/lupomontero/psl

Source:
Returns:
Type
string

noQuestionSearchString()

Get query parameters string after the initial "?" Chiefly used to set cookies later read by our backend

Source:
Returns:
Type
string

removeParams()

Remove query parameters from the location bar

(This is done via the history object)

Source:

uriAndQueryString()

Get the current location without hash

Source:
Returns:
Type
external:Location#hrefSansHash