When calling more than one field the query fails. No descriptive reason why.
[Shorthand as typing on phone]
Working code:
Function getData(){
ctx = new SP.ClientContext();
u = ctx.get_web().get_currentUser();
//ctx.load(u,"Email");
ctx.load(u,"LoginName");
ctx.loadQueryAsync(Disp,onFail)
}
Function Disp(){
//console.log(u.get_email());
console.log(u.get_loginName());
}
...fail function, etc..
I can choose to have email or loginName output successfully however ctx.loadQueryAsync fails if I try both. Each of the following has been tested in place of previously used load:
ctx.load(u,"Include(Email,LoginName)");
ctx.load(u,"Include(Email)");
ctx.loadQuery(u,"Include(Email)");
Using any of the above result in a failed query. Message is Invalid Request
a Microsoft.SharePoint.Client.InvalidQueryException
. Other error values are undefined