0

I am trying to get getJSON working on my IE, but I read that IE doesn't support it that well. So I decided to use ajax instead.

My code is:

$.ajax({ dataType: 'json', url: 'http://openexchangerates.org/latest.json', success: function(data) { alert('done'); } }); 

Thanks

1
  • 1
    Where did you read that? I'm not aware of any such issues. What is your problem? Commented Nov 27, 2011 at 21:34

2 Answers 2

0

You cannot make crossdomain ajax calls. Take a look at the top post at this SO post. If you have a specific need to do so, you need to use some sort of sockets. This can be file_get_contents in php or another server-side language

Sign up to request clarification or add additional context in comments.

1 Comment

jQuery will use JSONP for that.
-1

I had this problem just the other day. Internet Explorer doesn't like you doing cross-domain requests with AJAX.

I solved it by having a server-side script do the cross-domain API request, and then call the result of that script in my AJAX call.

2 Comments

this is not a IE issue, its the design of ajax itself.
I'm sorry, but why does that deserve a down-vote? I had a cross-domain request working in Chrome and Firefox, but not IE. Therefore, it's specific to IE.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.