2012-08-30 272 views
0

工作正常铬,FF,Safari等为什么这个ajax调用在IE中不起作用?

JSON响应似乎罚款...我猜它有什么我做什么或者在我的代码没有做的事:

var getPhotos = function() { 
    $.ajax({ 
    url: 'https://api.parse.com/1/classes/Photo', 
    headers: { 
     'X-Parse-Application-Id': config.parseAppId, 
     'X-Parse-REST-API-Key': config.parseRestKey 
    }, 
    type: 'GET', 
    dataType: 'json', 
    data: { 
     'where': '{"event": "' + <%= @event.id %> + '"}', 
     'order': '-createdAt', 
     'limit': '12' 
    }, 
    success: function (data) { 
     $('#community-gallery').children().remove(); 
     data.results.forEach(function (photo) { 
     $('#community-gallery').append($('<a href="'+photo.file.url+'" rel="gallery"><img src="'+photo.file.url+'" width="130" style="padding: 0px 15px 15px 0;" /></a>')); 
     }) 
    }, 
    error: function() { 
     alert('Problem reading photos'); 
    } 
    }); 
}; 
+0

IE的哪个版本? JavaScript控制台中是否出现任何错误? –

回答

0

而且使用的是$在你的append()里面调用时应该只是html内容。

+0

你可以这样做,它不会导致错误,只是有点不必要。 – mattmanser

+0

清理它......这是一个错字。 –

0

缓存:假的, 也是IE浏览器非常重要,从我的经验

+0

补充说,但仍然没有工作,但很棒的提示! –