Michael Damron - Home
SharePoint Scipts
|
ShowdowTech ASP.Net site.
|
ECMA scripts and the Client Object Modal (OM)
function showLogin()
{
var oContext, oWeb, oCurrentUser;
oContext = new SP.ClientContext.get_current();
oWeb = oContext.get_web();
oCurrentUser = oWeb.get_currentUser();
oCurrentUser.retrieve();
oContext.load(oCurrentUser);
oContext.executeQuerryAsync(_showLoginSuccess, _showLoginFail);
function _showLoginSuccess()
{
alert(oCurrentUser.get_loginName());
alert(oCurrentUser.get_title());
alert(oCurrentUser.get_email());
}
function _showLoginFail()
{
alert("Unable to get user info.");
}
}.
|