<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
Output:
Aaberg, Jesper, 555-0100,555-0120
Aaberg, Jesper, 555-0100,555-0120
************************************************************************************
The front-end page receives an instance of the JSON object:
<script>sendrecord (' 1 '); function Sendrecord (record) {var req = {user_id:<?php echo $userId;? >,record:record,}$.ajax ({url: "/3g/wall/ajax_send_record/", type: "Post", Data:req,datatype: "JSON",// The return data format is JSON object Success:function (res) {if (res.result==1) { ///Because it is passed over as a JSON object, so there is no <span style= "font-family: SimSun; " >json.parse () parsing </span>alert (' 11 ');} else if (res.result==2) {alert (' 22 ');} else if (res.result==3) {alert ('}},error:function '); {alert (' error000 '); Console.log (this);}});} </script>
<?php function Ajax_send_record () { $record = $_post (' record '); if ($record ==1) { $json [' result '] = 1; } ElseIf ($record ==2) {$json [' result '] = 2;} ElseIf (ElseIf ($record ==3) {$json [' result '] = 3;} $json = Json_encode ($json); echo $json; }? >