私のJSは、次のようなオブジェクトを作成しています。
それをPHPページに投稿したいと思います。
私が試したのはこれです:
var json = JSON.stringify(item_contents);
console.log(json);
jQ.post(
"http://somedomain.com/headlines/save_items/",
json,
function(data){
console.log("Data: ");
console.log(data);
alert("first success");
},
"json"
)
.success(function() {
alert("second success");
})
.error(function(data) {
alert("error: ");
console.log(data);
})
.complete(function() {
alert("complete");
});
...そして出力は常にエラーです。私はcakePHPを使用しています。何か助けはありますか?TIA !!!
編集:
現在、私のphpページにあるものは次のとおりです。
echo print_r($_POST);
空白または未定義の出力を取得しています。