In SharePoint 2010, we have a variable called _spPageContextInfo that provides current context information. We can use this to obtain the current site, user, etc.
See John Liu's post:
http://johnliu.net/blog/2012/2/3/sharepoint-javascript-current-page-context-info.html
Checking for this variable will improve performance in SharePoint 2010, as it can eliminate a call to get the current site, and possibly other values.
Comments: I am catching "_spUserId is undefined" when including this ALPHA. I assume this is because running from an HTML page in a doc lib is unsupported? Is there a plan to support this scenario? It is much simpler to deploy app to document library than to a customized aspx form. Thanks.
See John Liu's post:
http://johnliu.net/blog/2012/2/3/sharepoint-javascript-current-page-context-info.html
Checking for this variable will improve performance in SharePoint 2010, as it can eliminate a call to get the current site, and possibly other values.
Comments: I am catching "_spUserId is undefined" when including this ALPHA. I assume this is because running from an HTML page in a doc lib is unsupported? Is there a plan to support this scenario? It is much simpler to deploy app to document library than to a customized aspx form. Thanks.