如何解决将数据从 Ajax 添加到下拉列表
我想将此回复添加到我的下拉列表中。我怎样才能做到这一点 ?我尝试了很多解决方案,但我没有。我想添加从 ajax 返回“ data.ItemStatuses.Label ”的下拉列表
function getType() {
const linkUrl = new URL(location.href);
const queryString = linkUrl.search;
const queryParams = new URLSearchParams(queryString);
return queryParams.get("codeItem");
}
$.ajax({
type: "POST",dataType: "JSON",url: "/Settings/GetItemTypeStatuses",data: {
itemTypeName: document.getElementById("modelitemtype").value
},success: function (response) {
response.forEach(function myfunction(data,index) {
console.log(data.ItemStatuses.Label)
if (data.ItemStatuses.Label == "Aktif") {
console.log(data)
}
})
},error: function (error) {
hideProgressLoading()
ShowTypedMessage('error','An error has occurred. Please try again.');
self.checkedListoading = false;
}
});
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。