关于select的option为什么动态没有写入

Posted yuanmo

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了关于select的option为什么动态没有写入相关的知识,希望对你有一定的参考价值。

 function JizuHao(source) {
            var data = source[0].SYSTEM;
            if (data != null) {
                var arr = data.split(",")
                var ress = "";
                for (i = 0; i < arr.length; i++) {

                    ress += "<option value="" + arr[i] + "">" + arr[i] + "</option>";
                }
                $("#id_select").empty();
                $("#id_select").selectpicker(‘render‘);//添加
                $("#id_select").selectpicker(‘refresh‘);//添加
                $("#id_select").append(ress);
                $("#id_select").selectpicker(‘render‘);
                $("#id_select").selectpicker(‘refresh‘);
            }
            else {
                $("#id_select").empty();
                $("#id_select").selectpicker(‘render‘);
                $("#id_select").selectpicker(‘refresh‘);
            }
        }

 

以上是关于关于select的option为什么动态没有写入的主要内容,如果未能解决你的问题,请参考以下文章