简体   繁体   English

获取存储一个函数的变量的值

[英]Get value of variable that stores a a function

I know this is a SharePoint question, but I feel more like it is a javascript question also. 我知道这是一个SharePoint问题,但我感觉它更像是一个JavaScript问题。 I'm using this great tool to fill some of the fields in my SharePoint list (web part). 我正在使用这个很棒的工具来填充我的SharePoint列表(Web部件)中的某些字段。 It works great when I do this one by one, but I'm trying to request multiple column values, but I can't get it to work. 当我一个接一个地执行此操作时效果很好,但是我尝试请求多个列值,但无法正常工作。

var thisUsersValues = $().SPServices.SPGetCurrentUser({
fieldNames: ["ID", "Name", "SIP Address"],
debug: false
});

How can I get specific column value (eg "Name") from this array? 如何从此数组中获取特定的列值(例如“名称”)?

Thanks! 谢谢!

Looking at the source it appears that the SPServices.SPGetCurrentUser() function returns an associative array with the keys being the fieldNames that were passed to it. 源头看 ,似乎SPServices.SPGetCurrentUser()函数返回一个关联数组,其键为传递给它的fieldNames

This means to access the field you can use 这意味着访问您可以使用的字段

thisUserValues.Name

Or 要么

thisUserValues['Name']

Disclaimer: I have no experience with sharepoint or this particular jQuery library. 免责声明:我没有Sharepoint或这个特定jQuery库的经验。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM