public function billing()
{
//后台ajax验证
$result = array();
$cate['s_customer'] =$_post['s_customer'];
$result = m('customer')->where( $cate)->field('phone,c_name')->select();
$this->ajaxreturn($result,"json");
$this->display();
}
为什么显示的只是数组,而我原网页不显示了,,,难道我的输出有问题?
只出现[{"phone":"13802149988","c_name":"\u5f20\u4e09"},{"phone":"13802144455","c_name":"\u674e\u56db"}],f12检查,发现页面上也就只有这数组,,其他东西都没有。。
<script> <br> $('#s_customer').change(function(){ <br> <br> $.ajax({ <br> url:"{:u('crud/billing')}", <br> type:'post', <br> data:{ <br> name:$('#s_customer').val() <br> }, <br> datatype:'json', <br> success:function(data){ <br> if(data.success) <br> { $('#phone').html(data.msg) } <br> <br> else {alert("失败")} <br> <br> <br> }, <br> error:function(data){alert(data.status);} <br> }) <br> <br> <br> }) <br> <br> <br> </script>
怎么样才能实现二级联动呢。。
保君发免费网站系统使用说明:一、 本程序完全免费,并且,保证功能全部可以使用,且无后门及木马等,请放心使用。二、 如果发现问题,请及时联系我们,我们会义务尽力解决所反映的问题。或到本公司网站下载更新程序。三、 修改三个文件就能成为自己的网站:1、顶部图片LOGO.GIF,2、替换透明动画:LOGO.SWF,3、修改#sys123.asp中的内容为你想要的内容。
立即学习“PHP免费学习笔记(深入)”;
立即学习“PHP免费学习笔记(深入)”;
回复讨论(解决方案)
求大神出答案!!。。
$this->ajaxReturn 里面有个exit
$this->ajaxReturn 里面有个exit
嗯,,然后呢,我是初学者,所以还是不明白您的意思,详细点。。谢了!
thinkphp 的 ajax 响应默认是返回 json 的
再说你也通知 $.ajax 返回的是 json 替我解码(dataType:'json',)
但是你的返回结果中并没有 success 和 msg 项
而 $('#phone').html(data.msg) 中,data.msg 的内容应该是 html 代码
不要随意的去抄人家的代码,要理解为什么要那么写
thinkphp 的 ajax 响应默认是返回 json 的
再说你也通知 $.ajax 返回的是 json 替我解码(dataType:'json',)
但是你的返回结果中并没有 success 和 msg 项
而 $('#phone').html(data.msg) 中,data.msg 的内容应该是 html 代码
不要随意的去抄人家的代码,要理解为什么要那么写
谢谢指点!










