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
You can easily get it with:
var currentUrl = window.location.href;
or, if you want the original URL, use:
var originalUrl = window.location.origin;