problem description
js page error
the environmental background of the problems and what methods you have tried
this is a new editing page. The springMvc, used to return ModelAndView, did not return data, so it was wrong. I wanted to judge whether it was already false, or there was a problem with the error
.related codes
< script type= "text/javascript" >
$(function () {
$("-sharpitemTypeId").change(function() {
var itemTypeId = $(this).val();
$.doRequest("/present/getGoods.do",{
"itemType": itemTypeId
},function(result) {
if(result.resultCode == "SUCCESS"){
var optData = result.model;
$("-sharpgoodsId").html("");
var optHtml = "";
if(optData && optData.length > 0) {
for(var index in optData) {
var opt = optData[index];
var goodsId=0;
if(${not empty dbData}){
goodsId=${dbData.goodsId};//
}
if(opt.id==goodsId){
optHtml += "<option value=""+ opt.id +"" selected="selected" >"+ opt.name +"</option>";
}else{
optHtml += "<option value=""+ opt.id +"">"+ opt.name +"</option>";
}
}
}else {
optHtml = "<option value=""></option>";
}
$(optHtml).appendTo($("-sharpgoodsId"));
} else {
alert(result.resultMsg);
}
});
});
});
what result do you expect? What is the error message actually seen?