dist/jquery.documentsize.js
function guessDocumentSize( dimension, _document ) {
        var ddE = _document.documentElement;

        return Math.max(
            ddE.body[ "scroll" + dimension ], _document[ "scroll" + dimension ],
            ddE.body[ "offset" + dimension ], _document[ "offset" + dimension ],
            _document[ "client" + dimension ]
        );
    }
function guessDocumentSize( dimension, _document ) {
        var ddE = _document.documentElement;

        return Math.max(
            ddE.body[ "scroll" + dimension ], _document[ "scroll" + dimension ],
            ddE.body[ "offset" + dimension ], _document[ "offset" + dimension ],
            _document[ "client" + dimension ]
        );
    }
function guessDocumentSize ( dimension , _document ) { var ddE = _document . documentElement ; return Math . max ( ddE . body [ "scroll" + dimension ] , _document [ "scroll" + dimension ] , ddE . body [ "offset" + dimension ] , _document [ "offset" + dimension ] , _document [ "client" + dimension ] ) ; }
Returns a best guess for the window width or height. Used as a fallback for unsupported browsers which are too
broken to even run the feature test.

The conventional jQuery method of guessing the document size is used here: every conceivable value is queried and
the largest one is picked.

@param {string}   dimension    accepted values are "Width" or "Height" (capitalized first letter!)
@param {Document} [_document]
Returns a best guess for the window width or height . Used as a fallback for unsupported browsers which are too broken to even run the feature test .