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