
已解决问题
谷歌斯文的Gogo妈妈用户在提交了关于“郭鹤年jquery ajax 返回json类型,但是取不到内容,***.XXX得到的永远是undefined。N个小时前还是好的”的提问,欢迎大家涌跃发表自己的观点。目前共有1个回答,最后更新于2024-12-13T12:17:16。$.ajax({url:"checkcode.action",type:"post",async:false,data:{chkCode:function(){return$('#chkCode').val();}},dataType:'json',dataFilter:function(data,type){console.log(data);console.log(data.checked+""+data.chkCode);result=data.checked;//这个result在ajax外定义了console.log("result:"+result);}});这是我ajax部分的代码,在firedebug中,我输出了data,另外也尝试输出data.checked和data.chkCode但是,都是undefined,这到底是哪里错了,求高手指教!!希望大家能够帮助她。
详细问题描述及疑问:$.ajax({url:"checkcode.action",type:"post",async:false,data:{chkCode:function(){return$('#chkCode').val();}},dataType:'json',dataFilter:function(data,type){console.log(data);console.log(data.checked+""+data.chkCode);result=data.checked;//这个result在ajax外定义了console.log("result:"+result);}});这是我ajax部分的代码,在firedebug中,我输出了data,
另外也尝试输出data.checked和data.chkCode但是,都是undefined,这到底是哪里错了,求高手指教!!期待您的答案,你就是当代的活雷锋,太感谢了
!