一開始我是準備使用post進行ajax進行異步操作xhr=new XMLHttpRequest();
xhr.open('post','m.php',true);
xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xhr.send('date='+cdate); //cdate是獲取的日期值但是服務器的中$_POST['date']卻顯示為空,請問這是為什么呢?最后是換成了GET方法成功獲取數據xhr.open('get','m.php?date='+cdate,true); //cdate是獲取的日期值xhr.send();
ajax使用post方法傳遞數據,為什么服務器端卻接沒有檢測到傳入的數據?
精慕HU
2018-10-18 18:10:01