the $(Document). height() takes the right value, but I was trying to get it when the document was ready, which in case is how the code starts:
$(Document). ready(Function() {
Alert($(Document). height());
});
But I found that when using $(Document). ready, certain information was lost, since it runs when html is loaded and DOM is ready, so I used $(window). load that runs only when the entire page is fully loaded, including all frames, Objects and images.
So the code that works the way I wanted it to:
$(window). load(Function() {
var test = $(Document). height();
Alert(test);
});
That is, when the page is fully loaded, the code triggers an alert with the value of the total document height (html).
Have you tried the answers to that other question? If possible post your code - or maybe a link to your site - because without knowing its structure it is difficult to know what might be happening. When you say "different" do you mean quite different (like, with practical implications) or only marginally different (browsers sometimes calculate sizes slightly differently)? Finally, there are elements with 100% height or Divs with different scroll pattern?
– mgibsonbr