我正在使用laravel 5.0.我想使用jquery获取laravel页面的基本URL.我试过以下功能.
function getBaseURL () {
return location.protocol + "//" + location.hostname + (location.port && ":" + location.port) + "/";
}
Run Code Online (Sandbox Code Playgroud)
但这只是给出了http://localhost.我需要在jquery中使用我的完整基本URL.该怎么办?