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
  4. //below code provides the current site url using spservices
  6. var siteUrl = $().SPServices.SPGetCurrentSite();

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.