I recently upgraded my server to a much nicer server, and after a few minor bumps got almost everything working correctly. I am still having one issue though, and I’m stumped. On one of my pages I make a JQuery .get() call to a php page on my site to get some data to populate a calendar. The function I use to make the AJAX call is:
function getBlackoutData(packageNum, nights, arrivalDate) {
if(!isRunning) {
isRunning = 1;
bodates.length = 0;
$.get("getBlackOutData.php", {
pkg: packageNum,
additional_nights: nights,
arrivalDate: arrivalDate
}, function(data) {
$.each(data.info, function(n,object) {
$.each(object, function(key,val) {
pkgInfo += key + '=' + val + '&';
$('#' + key).text(val);
});
});
$.each(data.dates, function(key, value) {
bodates[key] = value;
var pickedDate= $("#Checkin").val();
var pickedDateSplit = pickedDate.split("/");
pickedDate = pickedDateSplit[2] + pickedDateSplit[0] + pickedDateSplit[1];
if(value == pickedDate && $("#Checkin").val() != ""){
alert("The date you have chosen is not available with your current package");
$("#Checkin").val('');
}
});
if(bodates.length >= 120) {
$('#customer_info').html("<div class=\"packageError\">We're sorry, it appears that this package is not currently available. Please try another package or call 1-888-923-3378 for further avaliablity.</div>");
}
$('#customer_info').show();
$('#retail').html(data.retailNightPrice);
custPrice = $('#price').html();
$('#discount').html(data.retailNightPrice - custPrice);
}, "json");
isRunning = 0;
}
}
This call worked great before I moved my server, and accessing the getBlackOutData.php page directly with appropriate $_GET parameters works as expected. Now not only do I not get the expected results from the AJAX call, I don’t even get an http response code (Which I view in FireBug). Also, using FirePHP, I am able to print debug data to my FireBug Console from the PHP page I am trying to access, so I know I am actually hitting the page. Does anyone know if this could be a JQuery error or even possibly a configuration error with the server itself?
Ok, problem solved! Apparently the old server didn’t seem to mind that the base href for the site was HTTPS, while the link to that particular page was only HTTP. This apparently caused issues with the AJAX request.