嗨,自从 1 周以来,我一直在努力使用此代码。当我按下对话框的按钮时,我无法弄清楚如何提醒 newsArray[i].Title。
函数 SaveUserToList 只是一个例子,我有很多代码。现在唯一的事情是我必须从新闻数组中的标题中获取值。
for(var i = 0; i< newsArray.length; i++){
$(cloneModalContent).dialog({
resizable: true,
width: "auto",
title: newsArray[i].Title,
modal: true,
buttons: {
Cancel: function() {
$(this).dialog('close');
},
'Confirm': function() {
SaveUserToList();
$(this).dialog('close');
}
});
}
function SaveUserToList(){
alert(newsArray[i].Title);
}