Posted By

Hirsel on 05/24/12


Tagged

get site sharepoint


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

hurcy


get Current SPSite


 / Published in: JavaScript
 

without trailing slash

  1. function getCurrentSpSite() {
  2. var pageUrl= window.location.href;
  3. var protocol = pageUrl.split("/")[0];
  4. var tempFarm= pageUrl.split("//")[1];
  5. var farm = tempFarm.split("/")[0];
  6. return protocol +"//" + farm + L_Menu_BaseUrl ;
  7. }

Report this snippet  

You need to login to post a comment.