2011-04-10 33 views
0

可能重複:
how to read files saved on the server using php and make a call to that php page using ajax to display the list of files怎麼辦開始使用jQuery的AJAX

如何使用從服務器上存儲的XML文件內容的第一個PHP,獲取文件夾列表,然後得到使用$.ajax GET方法從該XML文件獲取內容。

+0

此外,你爲什麼一直問同樣的問題一遍又一遍? http://stackoverflow.com/questions/5443640/how-to-read-files-saved-on-the-server-using-php-and-make-a-call-to-that-php-page#question, http://stackoverflow.com/questions/5463456/how-to-get-the-contents-from-php-page-to-the-javascript-page-using-ajax – 2011-04-10 21:26:51

回答

0

像這樣的東西?

$.ajax({ 
    url: 'returnXML.php', 
    dataType: 'xml', 
    success: function(data) { 
    //Whatever you want to do with that data. 
    } 
});