title: Accessing pages on Google Sites to load on my site
body: <p>Via javascript (jQuery) I'm trying to load the contents of some pages from Google Sites onto elements in pages in a different site. Using jQuery's load I get the expectable:</p>
  
  <pre><code>XMLHttpRequest cannot load https://sites.google.com/site/foo/home. No 'Access-Control-
  Allow-Origin' header is present on the requested resource. Origin 'http://bar' is 
  therefore not allowed access.
  </code></pre>
  
  <p>I tried with CORS, using the code below (which I found at <a href="http://www.html5rocks.com/en/tutorials/cors/" rel="nofollow">http://www.html5rocks.com/en/tutorials/cors/</a>), but got the same result.</p>
  
  <pre><code>function createCORSRequest(method, url) {
    var xhr = new XMLHttpRequest();
    if ("withCredentials" in xhr) {
      // XHR for Chrome/Firefox/Opera/Safari.
      xhr.open(method, url, true);
    } else if (typeof XDomainRequest != "undefined") {
      // XDomainRequest for IE.
      xhr = new XDomainRequest();
      xhr.open(method, url);
    } else {
      // CORS not supported.
      xhr = null;
    }
    return xhr;
  }
  
  function makeCorsRequest() {
    var url = 'https://sites.google.com/site/edumonkihelp/test0';
  
    var xhr = createCORSRequest('GET', url);
    if (!xhr) {
      alert('CORS not supported');
      return;
    }
  
    xhr.onload = function() {return xhr.responseText;};
    xhr.onerror = function() {alert('Woops, there was an error making the request.');};
    xhr.send();
  }
  </code></pre>
  
  <p>So I guess I have two questions:
  1. Can you access the contents of pages in Google Sites?
  2. Are there any other similar services out there that would allow you to do so?</p>
  
  <p>Thanks!</p>