我使用 htaccess 来获取漂亮的网址...
但是现在,我不明白为什么 ajax 请求返回带有多个参数的“404 not found”。
htaccess 后面的 url:delete.php?id=1,2,3,4 完美运行
htaccess 之后的 url:删除/1,2,3 但不起作用(错误 404)
访问:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^delete/(\w+)$ ./delete.php?id=$1
和ajax代码:
$('#delete').click(function () {
var Checkboxes = new Array();
i = 0;
$("li input:checked").each(function () {
Checkboxes[i] = $(this).val();
i++;
});
$.ajax({
type: "POST",
url: "delete/" + Checkboxes, //<-problem is here maybe problem with htaccess and multiple value?
success: function (msg) {
alert("Data deleted: " + msg);
}
});
});
但是,我不明白问题到底出在哪里?