I'm trying to modify some existing code that is breaking in IE8. From what I've read online, this is a common problem involving XDomainRequest and XMLHttpRequest.
I've not worked with AJAX in this fashion before, so I'm at a compete loss of what to do here. The code is as follows: (I've replaced sensitive information in brackets "[[" and "]]" with arbitrary variable names to identify where each one is used):
jQuery(document).ready(function() {
var base_url = '[[BASE_URL_1]]'; // DTRT for ajax requests (CORS over HTTP by default)
if (document.location.protocol == "https:") {
base_url = '[[BASE_URL_2]]'; // The proxy script that lets us do secure cross-domain AJAX requests
}
var classSpec = '$class_spec';
$('#[[ID_1]]').empty().addClass('loading'); // loading gif
$('#[[ID_2]]').empty().addClass('loading');
$.ajax( {
type: "GET",
url: base_url + '[[URL_1]]' + classSpec + '[[URL_2]]',
success: function (data) { $('[[ID_2]]').html(data).removeClass('loading'); }
} );
$.ajax( {
type: "GET",
url: base_url + '[[URL_1]' + classSpec + '[[URL_3]]',
success: function (data) { $('[[ID+1]]').html(data).removeClass('loading'); initialize(); }
} );
});
How can I modify this code to include support for IE8?