<script type="text/javascript">
function isIE()
{
var myNav = navigator.userAgent.toLowerCase();
return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;
}
jQuery(window).load(function()
{
if (isIE() <= 9 && window.XDomainRequest)
{
if (window.XDomainRequest)
{
var xdr = new XDomainRequest();
var query = "URL";
if (xdr)
{
xdr.onload = function()
{
alert(xdr.responseText);
}
xdr.onerror = function()
{ /* error handling here */ }
xdr.open('GET', query);
xdr.send();
}
}
}
else
{
jQuery.ajax(
{
type: "GET",
crossDomain: true,
url: "URL",
dataType: "json",
success: function(data)
{
alert("Success");
},
error: function(response, textStatus, errorThrown)
{
alert('not OK ' + response.responseText);
alert('not OK ' + textStatus.responseText);
alert('not OK ' + errorThrown);
}
});
}
});
</script>This code snippet is for Cross domain Ajax works with IE all version + chrome + Firefox.