Heim >Backend-Entwicklung >PHP-Tutorial >ajax 取值,该如何处理

ajax 取值,该如何处理

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-13 11:47:22801Durchsuche

ajax 取值

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


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

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn