xxxxxxxxxx
var height = Math.max( body.scrollHeight, body.offsetHeight,
html.clientHeight, html.scrollHeight, html.offsetHeight );
xxxxxxxxxx
document.body.scrollHeight
//or if your body has margins use
document.documentElement.scrollHeight