I am using jQuery 1.4.2 and trying to execute a simple AJAX request. The destination URL returns a JSON string (I checked it with jslint). The request works in Firefox and Chrome, but doesn’t want to work in IE8, and I can’t determine why. Here is the challenge:
jQuery.ajax({ url: 'http://' + domain + '/' + 'helper/echo/', dataType: 'json', success: function(data) { alert(data); }, beforeSend: function(request, settings) { alert('Beginning ' + settings.dataType + ' request: ' + settings.url); }, complete: function(request, status) { alert('Request complete: ' + status); }, error: function(request, status, error) { alert(error); } });
IE will execute the beforeSend callback and the error callback. Error warnings with message:
Error: This method cannot be called until the open method has been called.
My response header is returned with Content-Type: text/javascript; charset=UTF-8 Content-Type: text/javascript; charset=UTF-8 .
What is happening with IE? I start the server on localhost by making a request http: // localhost: 8080 / psx to http: // localhost: 8080 / helper . Maybe IE is blocking this request? I tried installing Fiddler to analyze request traffic, but it will not work on my machine because it is more likely blocked. Firebug allows me, but everything is fine there.
Thanks for the help!!!
checker
source share