Quantcast
Channel: jQuery Library for SharePoint Web Services
Viewing all articles
Browse latest Browse all 6517

Edited Feature: Improve Context Sensing [10136]

$
0
0
New private function called SPServicesContext() created to determine the context. A variable called SPServicesContext now holds as much context as can be determined.

// Get the current context (as much as we can) on startup
// See: http://johnliu.net/blog/2012/2/3/sharepoint-javascript-current-page-context-info.html
function SPServicesContext() {

// SharePoint 2010 gives us a context variable
if(typeof _spPageContextInfo !== "undefined") {
this.thisSite = _spPageContextInfo.webServerRelativeUrl;
this.thisList = _spPageContextInfo.pageListId;
this.thisUserId = _spPageContextInfo.userId;
// In SharePoint 2007, we know the site and UserId
} else {
this.thisSite = (typeof L_Menu_BaseUrl !== "undefined") ? L_Menu_BaseUrl : "";
this.thisList = "";
this.thisUserId = (typeof _spUserId !== "undefined") ? _spUserId : undefined;
}

} // End of function SPServicesContext


Viewing all articles
Browse latest Browse all 6517

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>