How to populate dropdownlist with JSON data as ajax response in jQuery

后端 未结 7 1231
梦谈多话
梦谈多话 2021-02-05 14:47

I am working on a j2ee application. In my application I have a drop-down list(or Select element). I want to populate this drop-down list with JSON data as a Ajax response.

7条回答
  •  情书的邮戳
    2021-02-05 15:36

    We can populate dropdown like below . it's very easy for you all i guess.

    var options = $("#options");
        $.getJSON("/Country/GetAll/", function(response) {
             $.each(response, function() {
             options.append($("

提交回复
热议问题