HTML
object
html : Useful namespace for helping with html utility functions
Kind: global namespace
- html :
object
- .resolvePath(path, baseUrl) ⇒
string
- .removeUrlQueries(path, baseUrl) ⇒
string
- .resolvePath(path, baseUrl) ⇒
string
html.resolvePath(path, baseUrl) ⇒ Given the path returns an absolute path resolved so relative linking works as expected.
Kind: static method of html
Returns: string
- a.href - the absolute path (or paths)
Param | Type | Description |
---|---|---|
path | string |
either a relative or full path inputted to an element. This can also be a path that has items separated by ‘,’ so that you can resolve multiple items at once, since we allow users to send us multiple files that way. |
baseUrl | string |
a separate entry for if you want your url to start differently. this defaults to your window.location.origin. Additionally removes all queries from the end of the url, leaving the input as just the origin and its pathname. For ex: ‘https://example.com/images/photo.png?version=2’ becomes ‘https://example.com/images/photo.png’ |
string
html.removeUrlQueries(path, baseUrl) ⇒ Removes all queries from the end of the url, leaving the input as just the origin and its pathname. For ex: ‘https://example.com/images/photo.png?version=2’ becomes ‘https://example.com/images/photo.png’
Kind: static method of html
Returns: string
- a.href - the absolute path
Param | Type | Description |
---|---|---|
path | string |
either a relative or full path inputted to an element. |
baseUrl | string |
a separate entry for if you want your url to start differently. this defaults to your window.location.origin. |