weixin_33735676 2017-06-12 04:46 采纳率: 0%
浏览 20

jQuery的VAR到PHP?


How can I print this json in the same php page I call this ajax?
It is returning a mysql select and is printing in console but I dont know how to print in php

$('.itemview').click(function (e) {
    e.preventDefault();
    var uid = $(this).data('id');
    $.ajax({
        type: "POST",
        url: "resources/controllers/get.php",
        data: 'id='+uid,
        dataType: "json",
        success: function (data) {
            if (data.success) {
                console.log(data.result);
                console.log(data.result.id);
                $("#MethodView").modal('show');
            } else {
                alert("error");
            }
        }
    });
});

I got this in console:

Object
bank_info:null
entry_day:"0"
entry_type:"now"
form_of_payment:"y"
form_of_receipt:"y"
id:"1"
installment:"n"
name:"Dinheiro"
tax:"n"
type:"immediate"

And i need to print this in the same page I call this ajax

  • 写回答

1条回答 默认 最新

  • weixin_33705053 2017-06-12 04:54
    关注

    If by php, you mean how to show data on modal then you can do the following:

    $("#MethodView").append('<div id="modal_data"></div>');
    $('#modal_data').html(''your response');
    $("#MethodView").modal('show');
    
    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大