$.ajax({ url: 'ajax.php', type: 'POST', data: {'data': 'hello'}, }) .done(function() { console.log("success"); }) .fail(function() { console.log("error"); }) .always(function() { console.log("complete"); });PHP文件<?php
$a=$_POST['data']; echo $a; ?>对PHP不熟,这样写却报错了,求解释,Notice: Undefined index: data in D:\WorkSpace\demo\php\ajax.php on line 2
添加回答
举报
0/150
提交
取消