jsp页面里的下拉框加载不出下拉框代码:信息来源:-请选择-script代码:$(function(){//页面加载函数就会执行,页面加载函数就会执行查询字典//加载企业性质$.post("${pageContext.request.contextPath}/baseDict_findByTypeCode.action",{"dict_type_code":"007"},function(data){//遍历JSON数据$(date).each(function(i,n){$("#enterpriseNature").append(""+n.dict_item_name+"");});},"json");});控制台打印显示能取到值:BaseDictAction中的findByTypeCode方法执行了....Hibernate:selectbasedict0_.dict_idasdict_id1_0_,basedict0_.dict_type_codeasdict_typ2_0_,basedict0_.dict_type_nameasdict_typ3_0_,basedict0_.dict_item_nameasdict_ite4_0_,basedict0_.dict_item_codeasdict_ite5_0_,basedict0_.dict_sortasdict_sor6_0_,basedict0_.dict_enableasdict_ena7_0_,basedict0_.dict_memoasdict_mem8_0_frombase_dictbasedict0_wherebasedict0_.dict_type_code=?[{"dict_id":"16","dict_item_code":"","dict_item_name":"私营","dict_type_code":"007","dict_type_name":"企业性质"},{"dict_id":"17","dict_item_code":"","dict_item_name":"国企","dict_type_code":"007","dict_type_name":"企业性质"}]小白跪求大神---
2 回答
qq_花开花谢_0
TA贡献1835条经验 获得超7个赞
你先看看$("#enterpriseNature")标签是否加载出来,如果后台能出来数据前台js也没有报错的话,可能是初始化调用的时候,该标签还没初始化完,你把js代码放在最后面试试
临摹微笑
TA贡献1982条经验 获得超2个赞
$(function(){//页面加载函数就会执行,页面加载函数就会执行查询字典//加载企业性质$.post("${pageContext.request.contextPath}/baseDict_findByTypeCode.action",{"dict_type_code":"007"},function(data){debugger//遍历JSON数据$(date).each(function(i,n){$("#enterpriseNature").append(""+n.dict_item_name+""); });},"json");});这边你看看你的data是啥,传送的是什么东西。你这边$.each的方法用的好像也不对哦$.each(arr1,function(i,val){})
添加回答
举报
0/150
提交
取消