Get the base URL without any query parameters or hash fragments.
If the input is not a string or is an empty string, an empty string will be returned.
Since
vx.x.x
Returns
The base URL without any query parameters or hash fragments.
Example
// Get base URL consturl = 'https://www.example.com/path/to/page' console.log( getBaseURL(url) ) =>https://www.example.com/path/to/page
Example
// Get base URL with query parameters consturl = 'https://www.example.com/path/to/page?param1=value1¶m2=value2' console.log( getBaseURL(url) ) =>https://www.example.com/path/to/page
Get the base URL without any query parameters or hash fragments.
If the input is not a string or is an empty string, an empty string will be returned.
Since
vx.x.x
Returns
The base URL without any query parameters or hash fragments.
Example
Example