无法在 jQuery 查询生成器中添加动态值

Unable to add dynamic values in jQuery query builder

我只想在 jQuery 查询生成器中动态地在 select 框中添加值,但我一直收到错误消息:

JSON.parse(data.CancerTypeList).forEach(function(index, val)

我为此使用的代码:

var that = this;
$.ajax({
    type: "POST",
    url: location.protocol + "//" + location.host + appContext,
    data: "command=CaseServices&action=getCanTypeByDiseaseSubTypeId&diseaseSubType=" + 2,
    dataType: 'json',
    success: function(data) {
        JSON.parse(data.CancerTypeList).forEach(function(index, val) {
            that.addOption(val.CancerTypeName);
        });
    }
});

从 ajax 我得到了 200,但没有在 select 中添加值。请帮忙

根据服务器的参数是

command=CaseServices
action=getCanTypeByDiseaseSubTypeId
diseaseSubType= 2

这是你需要的吗

你能拍下 jquery

中收到的对象的屏幕截图吗