ajax给select下拉框赋值,并清除缓存

$('#volunteer4').empty();

$.ajax({
                    type:"post",
                    url:url,
                    cache:false,
                    ifModified:true,
                    async:true,
                    success:function(data){
                        $("#volunteer4").append('<option>全部</option>');
                        for(var i=0;i<data.length;i++){
                        var volunteer=data[i];
                        $("#volunteer4").append('<option value="'+volunteer.codeid+','+volunteer.codeitemname+'"  >'+volunteer.codeitemname+'</option>');
                        }
                    }
                });

猜你喜欢

转载自blog.csdn.net/cxws110/article/details/92806336