Is there any way to get Root web url or site collection url

Nov 16, 2011 at 11:57 AM

Is there any way to get Root web url or site collection url using this library

Nov 17, 2011 at 5:03 AM
Edited Nov 17, 2011 at 6:02 PM

That's available in JavaScript and not needed by this library.  

 

var rootSite = window.location.protocol + "//" + window.location.hostname;

 

There is a function that is more useful for subsites, if you need it, that will get the current site's name: http://spservices.codeplex.com/wikipage?title=$().SPServices.SPGetCurrentSite&referringTitle=Documentation, which really overlaps the OOTB global variable: L_Menu_BaseUrl, to some degree. So you could use either one...

 

Hope this helps,

Matt