PHP 如何获取jsonp传的数组
本帖最后由 zl2727 于 2014-01-09 14:19:55 编辑
var urlstr = "{GID:'" + $("#hogid").val() + "',Name:'" + $("#txtName").val() + "',ProvinceID:'" + $("#ProvinceID").val() + "',CityID:'" + $("#CityID").val() + "',AreaID:'" + $("#AreaID").val() + "',Moblie:'" + $("#txtMobile").val() + "',Address:'" + $("#txtAddress").val() + "',PayType:'" + itemvalue + "'}";
$.ajax({
url: "http://www.xxx.com/car.php",
type: "POST",
data: urlstr,
async:false,
dataType:'jsonp',
jsonp: "callback",
jsonpCallback:"getgoods",
success: function (data) {
alert(data.res);
},
error: function (err) {
alert("网络加载繁忙,请刷新!");
}
});
$urlstr = $_POST;
echo $urlstr.Name;