This post gives you a brief overview of the spPageContextInfo object properties and how it can help you while developing SharePoint 2013 apps.

Please keep in mind that this is based on the Technical Preview…

If you create your own app in SharePoint 2013, you can make use of the _spPageContextInfo object that is provided when your app is loaded.

for example:

//Get the relative URL for the current SPWeb
var urlWeb = _spPageContextInfo.webServerRelativeUrl;

The following screenshot show you the properties and their values for the spPageContextInfo object in my app:

hope it helps!


PS: The object already existed in SharePoint 2010:

VN:F [1.9.22_1171]
Rating: 7.9/10 (7 votes cast)
VN:F [1.9.22_1171]
Rating: +5 (from 5 votes)
_spPageContextInfo, 7.9 out of 10 based on 7 ratings