 <p>Use <code>'body'</code> instead of <code>page</code>. <code>page</code> is not a defined variable.</p> <pre><code>$(document).ready(function() { var Side = $('body').text(); alert( Side ); }); </code></pre> <p>Other options are <code>document</code> or <code>html</code>, but these would also include non-body text, such as the contents of the <code>&lt;title&gt;</code> tags.</p> <p>If you want to strip out the JavaScript, you can use:</p> <pre><code>var Side = $('body').clone(); Side.find('script').remove(); // Remove &lt;script&gt; elements, etc. Side = Side.text(); </code></pre> <p>If you really want to strip all invisible items, use:</p> <pre><code>Side.find(':hidden').remove(); // instead of the second line </code></pre>