没经验折腾坏了..
$(document).ready(function(){
$.ajax({
type:"post",
url:'/TM/userController/getProjects.do',
dataType:"json",
success:function(json){
console.log(json.rows.length);
var str ="<select>"+"<option value=''>"+"请选择"+"</option>";
//str += "<option value='""'>"+"请选择"+"</option>";
for(i = 0;i < json.rows.length;i++){
str +="<option>"+json.rows[i].themeName+"</option>";
}
str +="</select>"
$("#project").html(str);
},
error:function(){
alert("error!");
}
});
});
网友评论