日期:2014-05-16  浏览次数:20515 次

ajax 取值
 
 $.ajax({
   type: "post",   
   url: "ddd.php",   
   data: {"inserted":[{"productionName":"空压机","product":"科兴","productionType":"KX-11D","fenjieselect":"分解","proctionNO":"02"},{"productionName":"空压机","product":"科兴","productionType":"KX-12D","fenjieselect":"分解","proctionNO":"03"}],"updated":[],"deleted":[]},   
   datatype: "text",
   success:function(data){
    alert (data);

 } 

})  


我在后台的PHP里如何取到inserted ,updated ,deleted 的值啊?
------解决方案--------------------
你不是写了POST接收吗? 在ddd.php 里面print_r($_POST)
------解决方案--------------------
<?php
if($_POST) {
  print_r($_POST);
  exit;
}
?>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js'></script>
<script>
$(function() {
  $.ajax({
    type: "post",   
//   url: "ddd.php",   
    data: {"inserted":[{"productionName":"空压机","product":"科兴","productionType":"KX-11D","fenjieselect":"分解","proctionNO":"02"},{"productionName":"空压机","product":"科兴","productionType":"KX-12D","fenjieselect":"分解","proctionNO":"03"}],"updated":[],"deleted":[]},   
    datatype: "text",
    success:function(data){
      alert (data);
    }
  });
});
</script>