title: How can I load cross domain html page with jQuery AJAX?
body: <p>How can I load cross domain HTML page with jQuery AJAX?</p>
  
  <p>Suppose I want to get a page outside my domain using jQuery AJAX:</p>
  
  <pre><code>$.get('http://www.domain.com/mypage.html', function(data) {
    alert(data);
  });
  </code></pre>
  
  <p>I will probably get this error message:</p>
  
  <blockquote>
    <p>XMLHttpRequest cannot load <a href="http://www.domain.com/path/filename" rel="nofollow">http://www.domain.com/path/filename</a>. Origin
    null is not allowed by Access-Control-Allow-Origin.</p>
  </blockquote>
  
  <p>we can't load cross domain page using AJAX because of the <a href="http://en.wikipedia.org/wiki/Same_origin_policy" rel="nofollow">Same-origin policy</a>.</p>
  
  <p>I could try using 'jsonp' to bypass this restriction:</p>
  
  <pre><code>$.ajax({
    type:     "GET",
    url:      url,
    dataType: "jsonp",
    success: function(data){
      console.log(data);
    }
  });
  </code></pre>
  
  <p>But what if 'jsonp' is not supported in this site? this could be a problem.</p>
  
  <p>What if I just want to read an external page and parse its HTML?</p>