JavaScript in HTML(Chapter 2 of Professional JavaScript® for Web Developers 2nd Edition)
2011-01-08 13:04
871 查看
For pages that require a lot of JavaScript code, this can cause a noticeable delay in page rendering, during which time the browser will be completely blank. For this reason, modern web applications typically include all JavaScript references in the <body> element, after the page content. HTML 4.01 defines an attribute named defer for the <script> element. The purpose of defer is to indicate that a script won ’ t be changing the structure of the page as it executes. As such, the script can be run safely after the entire page has been parsed. Setting the defer attribute on a <script> element effectively is the same as putting the <script> element at the very bottom of the page. Internet Explorer 5.5 introduced the concept of document modes through the use of doctype switching. The first two document modes were quirks mode , which made IE behave as if it were version 5 (with several nonstandard features), and standards mode , which made IE behave in a more standards - compliant way. Though the primary difference between these two modes is related to the rendering of content with regard to CSS, there are also several side effects related to JavaScript.
相关文章推荐
- Language Basics(Chapter 3 of Professional JavaScript® for Web Developers 2nd Edition)
- What Is JavaScript?(Chapter 1 of Professional JavaScript® for Web Developers 2nd Edition)
- Variables, Scope, and Memory(Chapter 4 of Professional JavaScript® for Web Developers 2nd Edition)
- 《Professional Javascript For Web Developers 3rd Edition》读书笔记:javascript闭包中的this对象
- Translation perface: <<Professional JavaScript for Web Developers, 3rd Edition>>
- professional javascript for web developers 2nd_edition读书笔记(一)
- professional javascript for web developers 2nd_edition读书笔记(二)
- Object of Event--《Professional JavaScript for Web Developer》
- The Book of JavaScript, 2nd Edition: A Practical Guide to Interactive Web Pages
- Professional javascript For Web Developers 第2版读书笔记第3集
- Professional JavaScript for Web Developers
- JavaScript UserAgent判断---摘自Professional JavaScript for Web Developers 3rd
- Professional javascript For Web Developers 第2版读书笔记之闭包
- XPath: A Syntax for Describing Needles and Haystacks(Chapter 3 of XSLT 2nd Edition)
- Professional javascript For Web Developers 第2版读书笔记第5集event事件
- Professional JavaScript for Web Developers P226
- 跨浏览器的事件处理方法(Professional JavaScript for Web Developers)
- Professional JavaScript for Web Developers
- Professional JavaScript for Web Developers -1
- 跨浏览器的事件处理方法(Professional JavaScript for Web Developers)