I am using laravel 5.0. I want to get base url of laravel page using jquery. I have tried the following function.
function getBaseURL () {
return location.protocol + "//" + location.hostname + (location.port && ":" + location.port) + "/";
}
But this gives only http://localhost. I need my full base url in jquery. What to do?