[英]When declaring a function to a variable that variable stores the function or a reference?
[英]Get value of variable that stores a a function
我知道這是一個SharePoint問題,但我感覺它更像是一個JavaScript問題。 我正在使用這個很棒的工具來填充我的SharePoint列表(Web部件)中的某些字段。 當我一個接一個地執行此操作時效果很好,但是我嘗試請求多個列值,但無法正常工作。
var thisUsersValues = $().SPServices.SPGetCurrentUser({
fieldNames: ["ID", "Name", "SIP Address"],
debug: false
});
如何從此數組中獲取特定的列值(例如“名稱”)?
謝謝!
從源頭看 ,似乎SPServices.SPGetCurrentUser()
函數返回一個關聯數組,其鍵為傳遞給它的fieldNames
。
這意味着訪問您可以使用的字段
thisUserValues.Name
要么
thisUserValues['Name']
免責聲明:我沒有Sharepoint或這個特定jQuery庫的經驗。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.