jQuery returns wrong witdh and height in Chrome 18.0.1025.168
<p>The following code does not return the correct size for the document.</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;script type="text/javascript" src="./scripts/jquery-1.7.2.js"&gt;&lt;/script&gt;
        &lt;script&gt;
            alert($(document).width());
        &lt;/script&gt;
    &lt;/head&gt;
    &lt;body style="width:100%"&gt;
        &lt;div style="width:100%" id="myappClientContainer"&gt;DEFAULT HTML&lt;/div&gt;
    &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>When I set the width of the content of the window to 320, the alert says 426.</p>

<p>The same code reports correctly when using Internet&nbsp;Explorer 9.0.8112.16421 for example.</p>

<p>Is this a bug with Chrome? Or with jQuery? Or anything else?</p>

<p>I have stumbled on this while trying to set a <code>div</code> inside a document to fill the entire size of the document, so maybe this is not the right way to get the dimensions of the entire document?</p>

<p>How do I fix this problem?</p>

<hr>

<p>UPDATE 1:</p>

<p>Following some advice below, I have tried both this:</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;script type="text/javascript" src="./scripts/jquery-1.7.2.js"&gt;&lt;/script&gt;
        &lt;script&gt;
            function sizeme() {
                alert($(document).width());
            }
        &lt;/script&gt;
    &lt;/head&gt;
    &lt;body style="width:100%" onload="sizeme()"&gt;
        &lt;div style="width:100%" id="myappClientContainer"&gt;DEFAULT HTML&lt;/div&gt;
    &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>and this:</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;script&gt;
            function sizeme() {
                alert($(document).width());
            }
        &lt;/script&gt;
    &lt;/head&gt;
    &lt;body style="width:100%" onload="sizeme()"&gt;
        &lt;div style="width:100%" id="myappClientContainer"&gt;DEFAULT HTML&lt;/div&gt;

        &lt;!-- YOUR jQuery SCRIPTS here before the '&lt;/body&gt;' tag + load from Google (it's faster). --&gt;
        &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"&gt;&lt;/script&gt;
        &lt;script&gt;
            (function($){ // remap '$' to jQuery
                 alert($(document).width());
            })(jQuery);
        &lt;/script&gt;
    &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>But I still get the wrong size in both of them (<strong>in Chrome 18.0.1025.168</strong>).</p>

<p>I am using jQuery 1.7.2.</p>
