How to get base url with jquery or javascript?

后端 未结 24 1424
忘掉有多难
忘掉有多难 2020-12-12 13:59

In joomla php there I can use $this->baseurl to get the base path, but I wanted to get the base path in jquery.

The base path may be any of the follo

24条回答
  •  青春惊慌失措
    2020-12-12 14:42

    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.

提交回复
热议问题