gpt4 book ai didi

javascript - 类型错误 : invalid 'in' operand obj fetching data using Jquery Json

转载 作者:行者123 更新时间:2023-11-30 07:39:46 26 4
gpt4 key购买 nike

<分区>

这是我的代码片段

      jQuery('select[name="' + element + '"]').html('<option value="">Select</option>');
jQuery.each(data, function(key, value) {
jQuery('select[name="' + element + '"]')
.append(jQuery("<option></option>")
.attr("value", key)
.text(value));
});

这是我从响应中得到的数组

   {"1":"470 - MAJOR JOINT REPLACEMENT OR REATTACHMENT OF LOWER EXTREMITY W\/O MCC","2":"885 - PSYCHOSES","3":"897 - ALCOHOL\/DRUG ABUSE OR DEPENDENCE W\/O REHABILITATION THERAPY W\/O MCC","4":"885 - PSYCHOSES","5":"470 - MAJOR JOINT REPLACEMENT OR REATTACHMENT OF LOWER EXTREMITY W\/O MCC"}

我收到此错误,我不知道为什么会收到此错误TypeError: invalid 'in' operand obj

编辑:为了消除混淆,我发布了发送请求所用的函数,如下所示:

        function  fetchValuesForDrgDefinition(url,drg) {
jQuery.ajax({
type: "json",
url: url,
}).success(function(data) {
appendOptionsInSelectBox(drg,data);
});

}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com