$ (document) .height () takes the right value, but I was trying to get it when the document was ready, which in the case is how the code starts:
$ (document) .ready (function () {
alert ($ (document) .height ());
});
But I discovered that while using $ (document) .ready, certain information was lost, since it executes when the html is loaded and the DOM is ready, so I used $ (window) .load that executes only when the entire page is fully loaded, including all frames, objects and images.
So the code that works the way I wanted it is:
$ (window) .load (function () {
var test = $ (document) .height ();
alert (test);
});
That is, when the page loads completely, the code triggers an alert with the total height of the document (html) value.