Skip to content
This repository has been archived by the owner on Dec 15, 2020. It is now read-only.

confuse about the body().clientWidth code ? #10

Closed
linhuiw opened this issue Sep 9, 2013 · 2 comments
Closed

confuse about the body().clientWidth code ? #10

linhuiw opened this issue Sep 9, 2013 · 2 comments

Comments

@linhuiw
Copy link

linhuiw commented Sep 9, 2013

I have saw the source code here .
k95s v0 jc q3q rja4 tfh

I just confuse about the body() , Under what circumstances can this code work and give what return .

Did you want to get the document.height at document.compatMode at BackCompat such as the code below

function body(){
        return (document.compatMode == "CSS1Compat") ?
        window.document.documentElement :
        window.document.body || null;
 };

thanks.

@kbjr
Copy link
Owner

kbjr commented Sep 9, 2013

that looks broken, actually. at one point there was a function called body defined in the code that did something like this:

var body = (function() {
  var body;
  return function() {
    return body = body || document.body || document.getElementsByTagName('body')[0];
  };
}());

but that function seems to be lost...

@linhuiw
Copy link
Author

linhuiw commented Sep 9, 2013

:) I know Thanks a lot .

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants