I need to make an ajax request, IE Works OK, Firefox URI DENIED.
I googled and I found the the only way is to use JSON to eliminate and restrictions.
Is there some one got any example?
Thanks
I need to make an ajax request, IE Works OK, Firefox URI DENIED.
I googled and I found the the only way is to use JSON to eliminate and restrictions.
Is there some one got any example?
Thanks
With jQuery it could look like this:
$.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?" +
"tags=cat&tagmode=any&format=json&jsoncallback=?",
function(data){
$.each(data.items, function(i,item){
$("<img/>").attr("src", item.media.m).appendTo("#images");
if ( i == 3 ) return false;
});
});
Alternatively, you can make your XMLHttpRequest specify your user-agent as IE (browser sniffing is stupid):
var req = new XMLHttpRequest();
req.setRequestHeader('User-Agent','MSIE 7.0');
req.open("GET", sURL, true);
req.onreadystatechange=function() {
if (req.readyState==4) {
alert(req.responseText);
}
}
req.send(null);
Or better yet, send a strongly worded e-mail to the site admin about their not accepting requests from non-IE browsers. In this day and age, building an IE-only site is unacceptable. It undermines the accessibility & usefulness of the web in so many ways.
Before you get in too deep, try using an absolute url in the request. The only difference I know of between IE and FIrefox that would apply here is that IE converts relative urls to absolute in http traffic.
If this is a cross-site issue (I don't think it is), try setting up a subdomain for your site (say, flickrapi.acme.com) that is a CNAME to api.flickr.com.