1 回答
TA贡献1799条经验 获得超8个赞
应用如下循环:
$.each(applicationTabId, function(key,value){
console.log(key);
console.log(value);
});
根据您现在提供的代码,更改您的代码,如下所示:
function getapplicationlogouturl(applicationTabId) {
FetchLogoutUrl = {
"applicationName": applicationTabId,
};
$.ajax({
type: "POST",
url: obj.endpoint,
dataType: "json",
data: JSON.stringify(FetchLogoutUrl),
context: document.body,
success: function (response) {
if (response != null ) {
for (var i = 0; i < response.length; i++) {
var appName = response[i].name;
var tabid = applicationTabId[appName];
//print key value data in console to check working fine
console.log(appName+'---'+tabid);
}
}
},
});
}
注意:- var appName每次迭代发生后,var tabid值都会改变。
- 1 回答
- 0 关注
- 80 浏览
添加回答
举报