title: Get another page's content in a variable with ajax
body: <p>Is there a way to set a javascript variable as the content of another HTML page? </p>
  
  <p>I tried:</p>
  
  <p><code>var X = $(http://www.website.com/home).html()</code></p>
  
  <p>but it didn't return anything.... Even tho it explains the idea... so... can anyone tell me how to do so please? Also the content of a certain <code>id</code> or <code>class</code> in that website, something like:</p>
  
  <p><code>var X=$(http://www.website.com/home "#id").html()</code></p>
  
  <p>It would really help me, thanks in advance!</p>