나는 파이어 폭스와 크롬하지만 완벽 IE 작동 다음 아약스 호출이 : 그 사실에 대해 알고
function getAJAXdates(startDate, numberOfNights, opts) {
var month = startDate.getMonth() + 1;
var day = startDate.getDate();
var year = startDate.getFullYear();
var d = new Date();
var randNum = Math.floor(Math.random()*100000000);
$.ajax({
type : "GET",
dataType : "json",
url : "/availability/ajax/bookings?rand="+randNum,
cache : false,
data : 'month='+month+'&day='+day+'&year='+year+'&nights='+numberOfNights,
contentType : 'application/json; charset=utf8',
success : function(data) {
console.log('@data: '+data);
insertCellData(data, opts, startDate);
},
error:function(xhr, status, errorThrown) {
console.log('@Error: '+errorThrown);
console.log('@Status: '+status);
console.log('@Status Text: '+xhr.statusText);
}
});
}
을 모든 변수는 올바른 내용을 전달하고 $ .ajax는 실제로 모든 매개 변수/값을 전달합니다.
LOG :
이
내가 오류에 무엇을 얻을 @error : 정의되지 않은 LOG : @status : parsererror LOG : @status 텍스트 : OK내가 캐시 문제에 대해 알고 있어요 IE와 무작위 매개 변수를 구현 그것을 취소합니다.
header('Content-Type: application/json; charset=utf8');
header("Cache-Control: no-cache");
header("Expires: 0");
header('Access-Control-Max-Age: 3628800');
header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE');
모든 : 여기
는{
"availability":[
{
"inventory_id":"5",
"booking_id":"21",
"start_date":"05-01-2010",
"number_nights":4,
"text":"deFrancisco, Martin - $500.00 ACTIVE",
"type":"BOOKING"
}
]
}
마지막으로 이들은 백엔드에서 다시 전송되는 헤더입니다 (내가 그것을 찰스를 사용하여 볼 수있어) 내가 다시 얻을 JSON입니다 아이디어?
contentType을 추가하여 문제가 해결되는지 확인했지만 문제가없는 경우에도 작동하지 않습니다. 덕분에 – Sam3k