作者:yi品天下 | 来源:互联网 | 2023-05-18 03:35
Irecentlyupgradedmyservertoamuchnicerserver,andafterafewminorbumpsgotalmosteveryth
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:
我最近将我的服务器升级到了更好的服务器,经过几次轻微颠簸后,几乎所有东西都正常运行。我仍然有一个问题,我很难过。在我的一个页面上,我对我网站上的php页面进行了JQuery .get()调用,以获取一些数据来填充日历。我用来进行AJAX调用的函数是:
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("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.
");
}
$('#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?
在我移动服务器之前,此调用很有效,并且使用适当的$ _GET参数直接访问getBlackOutData.php页面可以正常工作。现在我不仅没有从AJAX调用中获得预期的结果,我甚至没有得到http响应代码(我在FireBug中查看)。此外,使用FirePHP,我能够从我试图访问的PHP页面将调试数据打印到我的FireBug控制台,所以我知道我实际上正在访问该页面。有谁知道这可能是一个JQuery错误,甚至可能是服务器本身的配置错误?
2 个解决方案