Function
$().SPServices.SPGetCurrentSite
Functionality
This utility function, which is also publicly available, simply returns the current site's URL. It mirrors the functionality of the WebUrlFromPageUrl operation.
Syntax
$().SPServices.SPGetCurrentSite();
Example
var thisSite = $().SPServices.SPGetCurrentSite();
Available Options
None
Returns
The current site URL as a string. For example, if the current page is:
http://servername/sitename/Pages/default.aspx or
http://servername/sitename/Shared%20Documents/Forms/EditForm.aspx or
http://servername/sitename/Lists/Calendar/NewForm.aspxthe function will return:
http://servername/sitename