'GetUserData':function(loginName){
$().SPServices({
operation: "GetUserProfileByName",
AccountName: loginName, // replace adLogin with your string expression
completefunc:function(data,status) {
var profile = {};
$(data.responseText).find("PropertyData").each(function(idx, val) {
var $val = $(val);
var name = $val.find("Name").text();
var value = $val.find("Value").text();
profile[name] = value;
});
////////////debugger;
// At this point the profile object has all profile properties:
User.id = _spPageContextInfo.userId;
User.title = profile.Title;
User.userCountry = profile.UCBCountry;
User.loginName = profile.AccountName;
}
});
}
$().SPServices({
operation: "GetUserProfileByName",
AccountName: loginName, // replace adLogin with your string expression
completefunc:function(data,status) {
var profile = {};
$(data.responseText).find("PropertyData").each(function(idx, val) {
var $val = $(val);
var name = $val.find("Name").text();
var value = $val.find("Value").text();
profile[name] = value;
});
////////////debugger;
// At this point the profile object has all profile properties:
User.id = _spPageContextInfo.userId;
User.title = profile.Title;
User.userCountry = profile.UCBCountry;
User.loginName = profile.AccountName;
}
});
}
No comments:
Post a Comment