how to get the base url in javascript

前端 未结 10 1869
一整个雨季
一整个雨季 2020-12-01 04:12

I am building a website with CodeIgniter, I have various resources that I load with the base_url helper function like this

10条回答
  •  广开言路
    2020-12-01 04:34

    Should you want what is exactly specified in the web page, just use:

    document.querySelector('head base')['href']
    

提交回复
热议问题