E/ff/chrome the scrollheight/scrolltop/clientheight of Document.documentelement and Document.body and determines whether the scroll bar is pulled to the bottom of the page
DTD has been declared
Ie
Document.documentElement.scrollHeight Browser All content height, document.body.scrollHeight browser all content height
Document.documentElement.scrollTop Browser Scroll section height, Document.body.scrollTop always 0
Document.documentElement.clientHeight Browser viewable section height, document.body.clientHeight browser all content height
Ff
Document.documentElement.scrollHeight Browser All content height, document.body.scrollHeight browser all content height
Document.documentElement.scrollTop Browser Scroll section height, Document.body.scrollTop always 0
Document.documentElement.clientHeight Browser viewable section height, document.body.clientHeight browser all content height
Chrome
Document.documentElement.scrollHeight Browser All content height, document.body.scrollHeight browser all content height
Document.documentElement.scrollTop always scrolls part height for 0,document.body.scrolltop browser
Document.documentElement.clientHeight Browser viewable section height, document.body.clientHeight browser all content height
DTD not declared
Ie
Document.documentElement.scrollHeight Browser viewable section height, document.body.scrollHeight browser all content height
Document.documentElement.scrollTop always scrolls part height for 0,document.body.scrolltop browser
Document.documentElement.clientHeight always viewable part height for 0,document.body.clientheight browser
Ff
Document.documentElement.scrollHeight Browser viewable section height, document.body.scrollHeight browser all content height
Document.documentElement.scrollTop always scrolls part height for 0,document.body.scrolltop browser
Document.documentElement.clientHeight Browser All content height, document.body.clientHeight browser viewable part height
Chrome
Document.documentElement.scrollHeight Browser viewable section height, document.body.scrollHeight browser all content height
Document.documentElement.scrollTop always scrolls part height for 0,document.body.scrolltop browser
Document.documentElement.clientHeight Browser All content height, document.body.clientHeight browser viewable part height
Browser All content height that is the height of the entire frame of the browser, including the scroll strip volume go to part + visible part + bottom hidden section height sum
The browser scrolls the height of the scroll bar, which is the height of the top of the entire object, depending on the height.
In comprehensive
1, Document.documentElement.scrollTop and Document.body.scrollTop always have a 0, so you can use these two and to seek scrolltop
2, ScrollHeight, clientheight in the case of a DTD has been declared with the documentelement, not declared the case with the body
3, Document.documentElement.scrollTop in the case of undeclared is always 0, so it can be used to determine whether the DTD is declared;
So, to determine whether the scroll bar has been pulled to the bottom of the page, you can use the following code
<script>Window.onscroll=function (){ varMarginbot = 0; if(document.documentElement.scrollTop) {Marginbot= Document.documentElement.scrollHeight-(document.documentelement.scrolltop+document.body.scrolltop)-Document.documentElement.clientHeight; } Else{Marginbot= Document.body.scrollheight-document.body.scrolltop-Document.body.clientHeight; } if(marginbot<=0) { //Do somethingAlert (' Requesting data '); } }</script>