1、前端

    <script type="text/javascript">
function LoadData(arg){ arg.dept=$("#DeptStr").val();
arg.clas=$("#ClassStr").val();
arg.user=$("#UserName").val();
arg.tno=$("#tNo").text();
console.log(arg);
var JsonData = JSON.stringify(arg);
console.log(JsonData);
$.ajax({
type: 'POST',
url: "AP_TrainSatisfaction_Json.php",
contentType :"application/json", // 很重要
data: JsonData,
dataType: 'json',
success: function(data){
console.log(data);
// document.getElementById("mark").innerHTML=data["yesNo"]; }, //end success
error: function(data){
console.log(data);
alert( "error!!!"+data );
} //end error
});
} </script>

2 php

header("Content-Type: text/html;charset=utf-8");
header("Content-type:text/json "); $info = file_get_contents("php://input");
$data=json_decode($info,true); $XYdata=json_encode($data);
echo $XYdata;

最新文章

  1. 分享我基于NPOI+ExcelReport实现的导入与导出EXCEL类库:ExcelUtility (续篇)
  2. 深入浅出设计模式——建造者模式(Builder Pattern)
  3. BZOJ4155 : [Ipsc2015]Humble Captains
  4. thinkphp隐藏中url的index.php
  5. java学习容器
  6. make menuconfig 是一个目录。停止 错误解决
  7. 在android.app.Application中定义全局变量
  8. jQuery ajax - ajax() 方法
  9. 【GitHub-SwipeMenuListView】针对ListView item的側滑菜单
  10. Stm32高级定时器(四)
  11. Android 开发笔记 “调用WebService”
  12. jquery append 动态添加的元素绑定事件on
  13. 微调数据库表结构,30 分钟搞定 WordPress 数据库查询缓慢问题
  14. 服务注册中心之ZooKeeper系列(二) 实现一个简单微服务之间调用的例子
  15. 【Zabbix】Zabbix Server自动发现
  16. 洛谷P4774 屠龙勇士
  17. The Little Prince-12/08
  18. [phy]在uboot阶段失能phy芯片
  19. Python 匿名参数
  20. js-传送file

热门文章

  1. (转载)私人问卷收集系统-Surveyking问卷收集系统
  2. Andorid 11获取外部存储权限方法
  3. Linux 常用监控指标总结
  4. linux部署带ssl的nginx
  5. 【PyCharm】PyCharm设置深色背景
  6. HiveServer2启动报TezConfiguration类NoClassDefFoundError错误
  7. R6-2 二分查找
  8. select multiple 浏览器兼容
  9. Msp430 编写交通灯程序
  10. php7安装mogodb