title: Permission denied error when invoking cross domain AJAX using XDomainRequest
body: <p>I have created a php page that makes use of Google Javascript APIs. I am trying to use Ajax to populate the info windows of the markers dynamically, but get a permission denied error on the xdr.open line. I have checked the other posts relating to similar errors, and tried different changes, but still the same error.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"&gt;&lt;/script&gt;
  
  &lt;meta name="viewport" content="initial-scale=1.0, user-scalable=no" /&gt;
  &lt;style type="text/css"&gt;
  html { height: 100% }
  body { height: 100%; margin: 0; padding: 0 }
  #map_canvas { height: 100% }
  &lt;/style&gt;
  
  &lt;script type=text/javascript&gt;
  var marker;
  var map;
  var xdr;
  
  function loader()
  {
          alert("XDR onload");
          alert("Got: " + xdr.responseText);
  }
  
  function Info(pmarker)
  {
      google.maps.event.addListener(pmarker, 'mouseover', function()
      {
       if (window.XDomainRequest)
       {
          xdr = new XDomainRequest();
          if(xdr)
          {
              document.write('1');
  
              xdr.open("GET", "http://localhost/GMap/GroovyCaller.php?Node=Host1");
              xdr.send();
              document.write('2');
              xdr.onload = loader;
          }
  
          else
          {
              document.write('3');
              alert('Failed to create');
          }
       }
       else
       {
            document.write('4');
            alert('XDR does not exist');
       }
  });
  }
  function createMarker() {
  
      var myLatlng = new google.maps.LatLng(-34.397, 150.644);
      var marker = new google.maps.Marker({
          position: myLatlng,
          map: map,
          title:"Hello World!"
          });
          Info(marker);
  }
  function initialize()
  {
      var latlng = new google.maps.LatLng(-34.397, 150.644);
      var myOptions =
      {
          zoom: 8,
          center: latlng,
          mapTypeId: google.maps.MapTypeId.ROADMAP
      };
      map = new google.maps.Map(document.getElementById("map_canvas"),
      myOptions);
  
  
      createMarker();
  
  }
  
  
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body onload="initialize()"&gt;
  &lt;div id="map_canvas" style="width:100%; height:100%"&gt;&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>