Can't retrieve my XML via crossdomain on IE

I've take this piece of code from W3C School which works perfectly on Ie and Chrome withtout change but when I change the 'url' parameter with my url it only works in Chrome and not in IE :

<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function loadXMLDoc(url)
{
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    txt="<table border='1'><tr><th>Title</th><th>Artist</th></tr>";
    x=xmlhttp.responseXML.documentElement.getElementsByTagName("produits");
    for (i=0;i<x.length;i++)
      {
      txt=txt + "<tr>";
      xx=x[i].getElementsByTagName("produit");
        {
        try
          {
          txt=txt + "<td>" + xx[0].firstChild.nodeValue + "</td>";
          }
        catch (er)
          {
          txt=txt + "<td> </td>";
          }
        }
      xx=x[i].getElementsByTagName("nomprod");
        {
        try
          {
          txt=txt + "<td>" + xx[0].firstChild.nodeValue + "</td>";
          }
        catch (er)
          {
          txt=txt + "<td> </td>";
          }
        }
      txt=txt + "</tr>";
      }
    txt=txt + "</table>";
    document.getElementById('txtCDInfo').innerHTML=txt;
    }
  }
xmlhttp.open("GET",url,true);
xmlhttp.send();
}
</script>
</head>
<body>

<div id="txtCDInfo">
<button onclick="loadXMLDoc('http://www.sosmalus.tm.fr/fexpat/webservices/choix_produits.php?dev_statut=1&dev_fdpaysid=AF&dev_fddeffet=2012-06-07&dev_fdnbadu=1&dev_fdnbenf=0&dev_fadnaiss_a_1=1952-06-19')">Get CD info</button>
</div>

</body>
</html>

Do you have any idea of what's wrong with that? Thanks!

PS : I've added <?php header("Access-Control-Allow-Origin: *"); ?> in the distant page

Answers


I don't think IE supports CORS before IE10. The original code works for W3Schools probably because they are of the same origin.


Need Your Help

Python: inserting double or single quotes around a string

python sql quotes

Im using python to access a MySQL database and im getting a unknown column in field due to quotes not being around the variable.

usable D3 replacement in IE8 (graphs with D3 and svg)

html5 svg internet-explorer-8 d3.js shim

I have developed working D3 driven charts and as far as all the other browsers go, there are no problems.