我正在从 site.com/users/{username} 进行 Ajax 调用。
我想访问 site.com/account/deleteComment,但是当我在 FireBug 中检查时,它试图访问 site.com/users/account/deleteComment。
以下是我的代码:
$.ajax({
url: "../account/deleteComment/" + deleteID,
success: function () {
$("#comment-" + deleteID).slideUp("fast");
}
});
rootPath = "http://localhost/project"
,并将rootPath
添加到您指定的每个URL中。 - Pekka