Using $.get to print page Elements
<p>I'm trying to print the elements of a page using this code:</p>

<pre><code>$('#some_button').click(function(){
    var url = window.location.href;
    var contents = $.get(url);
    alert(contents.responseText);
});
</code></pre>

<p>but this returns a blank string, and trying to print <code>contents.status</code> gives me the error:</p>

<pre><code>Uncaught Error: INVALID_STATE_ERR: DOM Exception 11
</code></pre>

<p>This code works just fine from the browser console so it would seem this is a load state issue.  But because this is in a click listener I don't know how to solve this.</p>
