-1

/* 以同样的方式,我需要从由另一个列表中的多个列组成的查找列中获取值到变量中 */ url : _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getByTitle('Cities')/items ?$select=国家/标题&$expand=国家/标题",

4

1 回答 1

0

希望您在 data.d.results 中得到结果。

var results=data.d.results;
displayObjectProperty("getData",results,"Title");
function displayObjectProperty(id,object,Property){
                for(var x in object)
                {
                              if(typeof(object[x]) == "object"){displayObjectProperty(id,object[x],Property)}else{
                              if(x==Property){
                                              document.getElementById(id).innerHTML += "<b>" + x + "</b>"+"::<i>" + object[x] + "</i>";
                }
                }
                }

        }
于 2018-11-10T16:41:49.907 回答