url.js
- Source
Methods
(static) getAbsoluteURL(url) → {string}
Get absolute version of relative URL.
Parameters:
| Name | Type | Description | 
|---|---|---|
| url | string | URL to make absolute | 
- Source
Returns:
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.
Parameters:
| Name | Type | Description | 
|---|---|---|
| path | string | The fileName path like '/path/to/file.mp4' | 
- Source
Returns:
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.
Parameters:
| Name | Type | Attributes | Description | 
|---|---|---|---|
| url | string | The url to check. | |
| winLoc | URL | <optional> | the domain to check the url against, defaults to window.location | 
- Source
Returns:
Whether it is a cross domain request or not.
- Type:
- boolean
(static) parseUrl(url) → {URL}
Resolve and parse the elements of a URL.
Parameters:
| Name | Type | Description | 
|---|---|---|
| url | string | The url to parse | 
- Source
Returns:
An object of url details
- Type:
- URL