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
Put this in your header, so it will be available whenever you need it.
var base_url = "";
You will get http://localhost:81/your-path-file or http://localhost/your-path-file.
http://localhost:81/your-path-file
http://localhost/your-path-file