我嘗試後,像這樣一個Ajax請求:jQuery的AJAX發佈目錄
$.ajax({
url: 'directory/file.php',
type: 'POST',
data: 'param1=' + param1 + '¶m2=' + param2,
success: function(response){
$('#content').html(response);
}
});
當我使用此代碼段POST請求不起作用,但如果我移動的文件上一級目錄和使用:
$.ajax({
url: 'file.php',
type: 'POST',
data: 'param1=' + param1 + '¶m2=' + param2,
success: function(response){
$('#content').html(response);
}
});
然後它神奇地工作。
我曾嘗試:
/directory/file.php和FULLPATH /目錄/ file.php
我也包括在內的完整路徑,當我提出這一個目錄,它仍然工作。
我一定會看起來很簡單,但我無法弄清楚。
我沒有看到任何錯誤,但你有沒有嘗試添加../../或../或/之前的網址? – Peter 2011-02-22 18:53:21
是的,我嘗試了所有這些。 – Melissa 2011-02-22 18:57:43
在哪個目錄是file.php? – Val 2011-02-22 19:02:58