sharepoint root url


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. var rootUrl = "<asp:Literal runat='server' Text='<% $SPUrl:~SiteCollection/%>' />";
  2. //above code grabs top level site collection url
  3.  
  4. //below code provides the current site url using spservices
  5.  
  6. var siteUrl = $().SPServices.SPGetCurrentSite();

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.