原型+ Flickr Ajax请求不适用于Firefox [英] Prototype + Flickr Ajax Request doesn't work with Firefox
问题描述
您好,我在使用Flickr API时遇到一个奇怪的问题,在Flickr中,通过url格式与服务器建立连接是我的情况
Hi every one I have a weird issue I been working with the Flickr API, in Flickr for make a connection with the server is through url format in my case something like this
如果您在任何浏览器中运行,都将获得flickr函数并且可以,但是Im试图通过Prototype Im的Ajax进行获取
If your run into any browser you are going to get a flickr function and is ok, but Im trying to obtain with Ajax of Prototype Im doing something like
new Ajax.Request('http://api.flickr.com/services/rest/?method=flickr.photosets.getList&api_key=10cb3dccaa050efebdc01540c1d4d227&user_id=51390557@N07&format=json',
{
method:'get',
onSuccess: function(transport){
debugger;
var response = transport.responseText || "no response text";
alert("Success! \n\n" + response);
},
onFailure: function(){ alert('Something went wrong...') }
});
并且在IE中运行良好,但是在Firefox中,我不知道为什么我在responseText中获取了一个空白字符串".有什么线索我在做什么错吗?
And is working good in IE but in Firefox I dont know why Im getting in the responseText a blank string "". does any have any clue what am I doing wrong?
谢谢
推荐答案
我猜答案是因为firefox不接受跨域调用,因此我们可以使用JSONP来实现Prototype JS的实现,请访问:dandean.com /jsonp-for-prototypejs希望将来有人帮助这个问题并回答自我问题=)
I guess the answer is because firefox don't accept crossdomain callings, so for this we can use JSONP the implementation for Prototype JS can found in: dandean.com/jsonp-for-prototypejs hope some body help this question and answer self question in the future =)
最佳 纳胡姆(Nahum)
best Nahum
这篇关于原型+ Flickr Ajax请求不适用于Firefox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!