Module

base/utils/url

Members

Object

static constant params

Initial search parameters.

View Source utils/url.js, line 13

Methods

static hash(hrefopt) → {String}

Return hash part of given url.
Parameters:
Name Type Attributes Default Description
href String <optional>
window.location URL to return the hash from.

View Source utils/url.js, line 48

String

static parseQuery(queryopt, optionsopt) → {Object}

Return search parameters.
Parameters:
Name Type Attributes Default Description
query String <optional>
window.location.search.substring(1) Query string.
options Array <optional>
Parse options.

View Source utils/url.js, line 23

Object

static pushState(url, stateopt, titleopt)

Push state using native window.history and triggering `pushstate` event. Note that the parameter order is different from the native pushState method.
Parameters:
Name Type Attributes Default Description
url String URL to set
state Object <optional>
state to set
title String <optional>
'' title of page

View Source utils/url.js, line 60

static replaceState(urlopt, stateopt, titleopt)

Replace state using native window.history and triggering `replacestate` event. Note that the parameter order is different from the native replaceState method.
Parameters:
Name Type Attributes Default Description
url String <optional>
URL to set
state Object <optional>
state to set
title String <optional>
'' title of page

View Source utils/url.js, line 72

static stringifyQuery(obj, optionsopt) → {String}

Simple serialize.
Parameters:
Name Type Attributes Description
obj Object Object to serialize.
options Array <optional>
Stringify options.

View Source utils/url.js, line 38

String