title: Load XML with script
body: <p>I am trying to load an XML file with this script, but when I run the code and I press the "Button" I get this message: </p>
  
  <blockquote>
    <p>Blocked request from another source : the same origin policy prevents
    the remote resource read <a href="https://therouteofmyxml.xml" rel="nofollow">https://therouteofmyxml.xml</a> ( reason :
    missing CORS ' Allow- Access- Control- header Origin ' ).</p>
  </blockquote>
  
  <p>Is it because I have any extension or plugin on my browser? Thanks!!</p>
  
  <pre><code>&lt;script&gt;
          function loadXMLDoc(){
              xmlhttp=null;
              if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
                  xmlhttp=new XMLHttpRequest();
              }
              else{// code for IE6, IE5
                  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
              if (xmlhttp!=null){
                  xmlhttp.onreadystatechange=function(){
                      if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200){
                          xmlDoc=xmlhttp.responseXML;
                          var txt="";
                          x=xmlDoc.getElementsByTagName("offer");
                          for (i=0;i&lt;x.length;i++){
                              txt=txt + x[i].childNodes[0].nodeValue + "&lt;br&gt;";
                          }
                          document.getElementById("myDiv").innerHTML=txt;
                      }
                  }
                  xmlhttp.open("GET","https://therouteofmy.xml",true);
                  xmlhttp.send();
              }
              else{
                  alert("Your browser does not support XMLHTTP.");
              }
          }
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;div id="myDiv"&gt;&lt;/div&gt;
  &lt;button type="button" onclick="loadXMLDoc()"&gt;Mis Ofertas&lt;/button&gt;
  </code></pre>