創建的POST
問題在後的jquery
var p = {Name: obj.Name, Age: obj.Age},
str = JSON.stringify(p);
$.post("test.php", str, function (data) {
alert("Post finished");
}).success(function() {
alert("second success");
}).error(function() {
alert("error");
});
短例如當運行上述代碼時,它從test.php
拋出的404 not found
錯誤消息。
我在我的項目中創建了這個文件test.php
。
爲什麼會出現這個錯誤?
您是否在發佈此問題前直接在瀏覽器中打開test.php? –
這似乎是'PHP'問題而不是'jQuery'問題,因爲您應該知道如何設置PHP頁面的根目錄,然後使用那些具有'$ .post'的URI' – InspiredJW