我正在使用 jquery$.post
向另一个域发送发布请求。一切正常,但我没有在请求的页面中获得发布的数据请检查我的代码
jQuery代码
var data = {mydata: 'testing'};
$.post("http://anyurl/file.php",data,function(info){
alert(info);
});
这是php代码
<?php
header('Access-Control-Allow-Origin: *'); // this is to allow another domain
$data = $_POST[“mydata”]; // assigning data to variable
echo $data; // sending back to jquery
?>
它不返回数据请检查任何人。
提前致谢