title: Substitute for Cross-domain request with JavaScript
body: <p>I have a JavaScript on a server named <code>kopernikus.science.net</code> that wants to access a file on a different server named <code>galileo.science.net</code>. Here a toy example of what I have in mind:</p>
  <pre><code>code residing on  http://kopernikus.science.net/makecalendar.js :
  
      var request = new XMLHttpRequest();
      request.open(&quot;GET&quot;,&quot;galileo.science.net/calendar&quot;, false);
      request.send(null);
      document.getElementById(&quot;calendar&quot;).innerHTML =
          &quot;&lt;div&gt;&quot; + request.responseText.split('\n')[0] + &quot;&lt;/div&gt;&quot;;
  </code></pre>
  <p>Unfortunately, due to the &quot;same origin policy&quot; of modern web browsers, the script is forbidden from accessing the data on a different domain.</p>
  <p>Of course, my question is:</p>
  <blockquote>
  <p>How can I access the remote file anyway?</p>
  <p>Solutions outside JavaScript are allowed, like mirroring the file in question or tweaking <code>.htaccess</code>. What are my options? Which require the least amount of permissions on the web server?</p>
  </blockquote>
  <p>The file in question is a calendar in vcalendar format which changes regularly. I'm on a shared host and don't have sysadmin rights, but I can run PHP and CGI scripts and can change some parts of the <code>.htaccess</code> file.</p>