In joomla php there I can use $this->baseurl to get the base path, but I wanted to get the base path in jquery.
$this->baseurl
The base path may be any of the follo
Here's a short one:
const base = new URL('/', location.href).href; console.log(base);