$.ajax({
type: 'POST',
url: "${base}/smallLine/findSmallByBigLineId.do",
data: "bigLineId="+bigLine,
success: function(data){
$("#smallLineId").empty();
$("#smallLineId")("");
var options = "";
for ( var i = 0; i < data.smallLinesList.length; i++) {
var smallLine = data.smallLinesList[i];
options+="<option value='"+smallLine.id+"'>"+smallLine.name+"</option>";
}
$("#smallLineId").append(options);
$("#smallLineId")(options);
$("#smallLine").attr("style","");
},
dataType: "json"
});
------最佳解决方案--------------------------------------------------------
success: function(data){
$("#smallLineId").empty();
// $("#smallLineId")("");
var options = "";
for ( var i = 0; i < data.smallLinesList.length; i++) {
var smallLine = data.smallLinesList[i];
options="<option value='"+smallLine.id+"'>"+smallLine.name+"</option>";
$("#smallLineId").append(options);
}
// $("#smallLineId")(options);
$("#smallLine").attr("style","");
},
------其他解决方案--------------------------------------------------------
var options = "";
for ( var i = 0; i < data.smallLinesList.length; i++) {
var smallLine = data.smallLinesList[i];
options+="<option value='"+smallLine.id+"'>"+smallLine.name+"</option>";