die(json_encode(... 没返回
我的ajax代码
<br />$.post('{:U("Safeinfo/txpassadd")}', $("#txadd").serialize(), function(data) {<br /> alert("ok"); ...<br />
<br />tip("100", '<font color="red">交易密码不能与登录密码一样!</font>');<br />
<br />function tip($code, $msg) {<br /> $arr['code'] = iconv('GB2312', 'UTF-8', $code);<br /> $arr['msg'] = iconv('GB2312', 'UTF-8', $msg);<br /> <br /> //die(json_encode($arr));<br /> die(var_json_encode($arr)); //cjq<br />}<br /><br />function var_json_encode($var){ <br /> $_var = var_urlencode($var); <br /> $_str = json_encode($_var); <br /> return urldecode($_str); <br />}<br />
<br />function tip($code, $msg) {<br /> $arr['code'] = iconv('GB2312', 'UTF-8', $code);<br /> $arr['msg'] = iconv('GB2312', 'UTF-8', $msg);<br /> <br /> die(json_encode($arr,JSON_UNESCAPED_UNICODE)); //cjq<br />}<br />
function tip($code, $msg) {<br /> $arr['code'] = iconv('GB2312', 'UTF-8', $code);<br /> $arr['msg'] = iconv('GB2312', 'UTF-8', $msg);<br /> <br /> die(json_encode($arr));<br />// die(var_json_encode($arr)); //cjq<br />}<br />
function tip($code, $msg) {<br /> $arr['code'] = iconv('GB2312', 'UTF-8', $code);<br /> $arr['msg'] = iconv('GB2312', 'UTF-8', $msg);<br /> <br />// die(json_encode($arr));<br /> die(var_json_encode($arr)); //cjq<br />}<br />