URL module.
Members
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. |
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. |
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 |
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 |
static stringifyQuery(obj, optionsopt) → {String}
Simple serialize.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
obj |
Object | Object to serialize. | |
options |
Array |
<optional> |
Stringify options. |
String