1
將記錄插入到數據庫時,服務器返回'undefined index:category',錯誤,但仍然成功發佈。PHP + jQuery - 未定義的索引:,但它仍然成功發佈?
$('#button').click(function(){
var newvendor = $('#input_vendor').val();
newplantcode = $('#input_plantcode').val();
newcategory = $('#input_category').val();
$.post("php/addSite.php",
{vendor: newvendor,
plant_code: newplantcode,
category: newcategory}, // <--- Error on this line, for some reason...
function(result){
console.log("server returned : " + result);
[ RELOAD THE PAGE ]
}
看控制檯。顯示的代碼看起來很好,除了語法...或者在第二個和第三個變量聲明中加上'var',或者用逗號分隔它們 – charlietfl
這就是它......謝謝! –