我有一个带有字母的列表导航,当用户单击一个字母时,我试图从不同的 json 文件中调用演员和导演。我使用了 2 个 ajax 调用从 actor.php 和 director.php 获取数据。它在我的本地机器上运行良好,但只有第一个在服务器上运行。如何使每个 ajax 调用正常工作?
$(document).ready(function(){
$('.letters').click( function(){
var letter=$(this).html();
$.ajax({
url: 'actor.php?harf='+letter,
dataType: 'json',
success: function(JSON)
{ //some code }
});
$.ajax({
url: 'director.php?harf='+letter,
dataType: 'json',
success: function(JSON)
{ // some code }
}); }); });