我正在建立我的第一个“漂亮url”网站,但是当我尝试运行任何AJAX请求功能时,它们没有被传递到正确的文件(submit.php)
我有1个文件,其中包含所有AJAX请求(http://mdloring.com/ezleague/submit.php):
function joinLeague(guild, league) {
$.ajax({
type: "POST",
url: "submit.php",
data: "form=joinLeague&guild=" + guild + "&league=" + league
}).success(function( msg ) {
$('.login_success').css("display", "");
$(".login_success").fadeIn(1000, "linear");
$('.login_success_text').fadeIn("slow");
$('.login_success_text').html(msg);
//setTimeout(function(){location.reload()},3000);
});
}
在我的“漂亮网址”页面之一(http://mdloring.com/ezleague/game/counter-strike)上,我有一个触发上述功能的按钮,但它尝试将请求传递给的网址是:http ://mdloring.com/ezleague/game/counter-strike/submit.php,而不是http://mdloring.com/ezleague/submit.php
我真的迷失了这一点。非常感谢您的帮助。
其归因于相对网址格式。尝试使用绝对网址格式
AJAX调用中的网址:“ http://mdloring.com/ezleague/submit.php ”
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句