/ Published in: JavaScript
without trailing slash
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function getCurrentSpSite() { var pageUrl= window.location.href; var protocol = pageUrl.split("/")[0]; var tempFarm= pageUrl.split("//")[1]; var farm = tempFarm.split("/")[0]; return protocol +"//" + farm + L_Menu_BaseUrl ; }