亚洲最大看欧美片,亚洲图揄拍自拍另类图片,欧美精品v国产精品v呦,日本在线精品视频免费

  • 站長(zhǎng)資訊網(wǎng)
    最全最豐富的資訊網(wǎng)站

    thinkphp中ajaxReturn的用法示例

    下面由thinkphp框架教程欄目給大家介紹thinkphp中ajaxReturn的用法 ,希望對(duì)需要的朋友有所幫助!

    thinkphp中ajaxReturn的用法示例

    1.例子:

    if ($codeid = $model->addCustomer($this->admin["id"])) {             $data["code"] = 10000;             $data["message"] = "添加客戶成功??蛻艟幪?hào)為:{$codeid}";             $data["data"] = 0;              $this->ajaxReturn($data);         } else {             $data["code"] = 10001;             $data["message"] = $model->failAddCustomer();             $data["data"] = 0;              $this->ajaxReturn($data);         }

    2.返回?cái)?shù)據(jù):

    $data

    3.接收數(shù)據(jù)。

    例如:

    $.ajax({                     type : "POST",                     url : "<?php echo U('policy/addCustomer'); ?>",                     dataType : "JSON",                     data : data,                     success : function(eve)                     {                         alert(eve.message);                          if (eve.code == 10000)                         {                             window.location.reload();                         }                      }                 });

    贊(0)
    分享到: 更多 (0)
    網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)