url.js
- Source
Methods
(static) getAbsoluteURL(url) → {string}
Get absolute version of relative URL.
Name | Type | Description |
---|---|---|
url | string | URL to make absolute |
- Source
Absolute URL
- Type:
- string
(static) getFileExtension(path) → {string}
Returns the extension of the passed file name. It will return an empty string if passed an invalid path.
Name | Type | Description |
---|---|---|
path | string | The fileName path like '/path/to/file.mp4' |
- Source
The extension in lower case or an empty string if no extension could be found.
- Type:
- string
(static) isCrossOrigin(url, winLocopt) → {boolean}
Returns whether the url passed is a cross domain request or not.
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
url | string | The url to check. | |||||||||||||
winLoc | Object | <optional> | the domain to check the url against, defaults to window.location Properties
|
- Source
Whether it is a cross domain request or not.
- Type:
- boolean
(static) parseUrl(url) → {module:url~url:URLObject}
Resolve and parse the elements of a URL.
Name | Type | Description |
---|---|---|
url | String | The url to parse |
- Source
An object of url details
- Type:
- module:url~url:URLObject
Type Definitions
url:URLObject
- Object
Name | Type | Description |
---|---|---|
protocol | string | The protocol of the url that was parsed. |
hostname | string | The hostname of the url that was parsed. |
port | string | The port of the url that was parsed. |
pathname | string | The pathname of the url that was parsed. |
search | string | The search query of the url that was parsed. |
hash | string | The hash of the url that was parsed. |
host | string | The host of the url that was parsed. |
- Source