当前位置 :
【AJAX的json问题关于JSON的返回值问题求解决:jsp页面代码:x05x05x05$(document).ready(function(){x05x05x05x05$("#btn1").click(function(){x05x05x05x05x05$.ajax({x05x05x05x05x05x05url:"auditImage.htm?method=jsonTest",】
更新时间: 2025-08-18 08:22:12
1人问答
问题描述:

AJAX的json问题

关于JSON的返回值问题求解决:

jsp页面代码:

x05x05x05$(document).ready(function(){

x05x05x05x05$("#btn1").click(function(){

x05x05x05x05x05$.ajax({

x05x05x05x05x05x05url:"auditImage.htm?method=jsonTest",

x05x05x05x05x05x05data:{name:$("#name").val(),pwd:$("#pwd").val()},

x05x05x05x05x05x05dataType:'json',

x05x05x05x05x05x05success:function(result){x05

x05x05x05x05x05x05x05alert(result);

x05x05x05x05x05x05}

x05x05x05x05x05});

x05x05x05x05});

x05x05x05});

x05x05

后台代码如下:

x05publicModelAndViewjsonTest(HttpServletRequestrequest,

x05x05x05HttpServletResponseresponse)throwsIOException{

x05x05response.setHeader("Pragma","No-cache");

response.setHeader("Cache-Control","no-cache");

response.setDateHeader("Expires",0);

x05x05Stringresult="";

x05x05Stringname=request.getParameter("name");

x05x05Stringpwd=request.getParameter("pwd");

x05x05JSONArrayjsonArray=newJSONArray();//json数据集

x05x05AuditImageDtoauditImageDto=newAuditImageDto();

x05x05Listlist=this.auditImageDlgt.queryAuditImage(auditImageDto);

x05x05ListdtoList=newArrayList();

x05x05for(inti=0;i

陈含章回答:
  你后台写的不对~   //-----------------------------------------------   JSONObjectjson=newJSONObject();   //得到你的数据   goodbusbud=newgoodbus();//   ArrayListlist=bud.allGood();   try{   JSONArraymembers=newJSONArray();   for(inti=0;i
最新更新
保卡通(baokatong.com)汇总了汉语字典,新华字典,成语字典,组词,词语,在线查字典,中文字典,英汉字典,在线字典,康熙字典等等,是学生查询学习资料的好帮手,是老师教学的好助手。
声明:本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
Copyright©2009-2021 保卡通 baokatong.com 版权所有