Home > Web Front-end > JS Tutorial > Under XHTML, the problem of invalid JS floating code_javascript skills

Under XHTML, the problem of invalid JS floating code_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 18:41:53
Original
1361 people have browsed it

Couplet code, check its expression under xhtml, the result is very simple. This is because, according to standards, the scroll bars of the form we see should not be of the body, but of the HTML (that is, the document.documentElement object). Therefore, the solution is: put the non-standard code in the html " document.body.scrollTop" is transformed into "document.documentElement.scrollTop", everything is ok!

(Invalid scope: XHTML 1.0 transitional.dtd; XHTML 1.0 strict.dtd; It is generally sufficient to replace the body with document.documentElement, but if it is to be compatible with non-xhtml situations, generally one judgment is
scrollTop=document.body.scrollTop?document.body.scrollTop:document.documentElement and other judgments


http://www.jb51.net/article/19931.htm

http://www.jb51.net/article/2447.htm
In fact, everyone can Read more articles previously published by Script House.

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Where is js written?
From 1970-01-01 08:00:00
0
0
0
js file code not found
From 1970-01-01 08:00:00
0
0
0
js addClass not working
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template