标签:ons .ajax type cti ++ json nbsp option select
<select name="elements" id="ele" style="width: 145px;">
</select>
function for_elements(){
$.ajax({
url : ‘selectElements‘,
data : {
},
dataType : ‘json‘,
success : function(s) {
var datas=s.obj;
var optionstring = "";
for (var j = 0; j < datas.length; j++) {
optionstring += "<option value=\"" + datas[j].name + "\" >" + datas[j].name + "</option>";
}
$("#ele").html("<option value=‘‘>全部</option> "+optionstring);
}
});
}
标签:ons .ajax type cti ++ json nbsp option select
原文地址:http://www.cnblogs.com/guolsblog/p/6016865.html