`

犀牛书第五版读书笔记——Chapter 13. JavaScript in Web Browsers(第二部分)

阅读更多
12.当有多个onload事件处理函数注册,浏览器会调用所有的处理函数,但是调用的顺序则无从保证

13.文档解析已经完成之后绝对不能调用document.write()方法。这样做的话,将创建一个新的document,并覆盖掉现有的document,用户甚至没有机会看到现有的document

14.javascript是单线程的。因此两个事件处理函数绝对不会同时执行

15.单线程也带来一些问题:它意味着javascript代码不能执行太长时间。如果javascript代码执行太久,会延迟document的载入,用户直到代码执行完成之间,都看不到页面。如果事件处理函数执行太久,则执行期间浏览器会停止响应,用户可能会认为网页已经崩溃了

16.一般来说,不推荐在文档解析过程中,对文档内容进行操作。经验丰富的javascript程序员通常采用的做法,是在文档解析完成后,再对文档进行操作。否则可能会出现一些奇怪的问题

17.javascript程序一个不能回避的问题,就是跨浏览器兼容性

18.网页过多地依赖javascript代码,可能会带来可访问性的问题。比如有的用户使用的是移动设备,和声音阅读器之类的,要注意这种情况。当然,在国内这种情况似乎不多

19.为了安全性的考虑,客户端javascript有意屏蔽了很多功能,比如删除文件,创建网络socket等,因为这些功能可以被恶意javascript代码用来做一些危险的事,损害用户的安全

20.javascript一般遵循“同源策略”,来保证安全性,不同的浏览器对同源策略的实现也不一样
分享到:
评论

相关推荐

    HTML5 and JavaScript Web Apps【PDF新书】

    Chapter 2. The Mobile Web Chapter 3. Building for the Mobile Web Chapter 4. The Desktop Web Chapter 5. WebSockets Chapter 6. Optimizing with Web Storage Chapter 7. Geolocation Chapter 8. Device ...

    JavaScript权威指南(第6版).JavaScript:The.Definitive.Guide

    Chapter 13 JavaScript in Web Browsers Chapter 14 The Window Object Chapter 15 Scripting Documents Chapter 16 Scripting CSS Chapter 17 Handling Events Chapter 18 Scripted HTTP Chapter 19 The jQuery ...

    JavaScript权威指南(第6版)--JavaScript:The.Definitive.Guide

    Chapter 13 JavaScript in Web Browsers Chapter 14 The Window Object Chapter 15 Scripting Documents Chapter 16 Scripting CSS Chapter 17 Handling Events Chapter 18 Scripted HTTP Chapter 19 The jQuery ...

    JavaScript权威指南第五版【新】(犀牛书)

    这本最畅销的JavaScript参考书的第四版已经进行了全面的更新,其中涵盖JavaScript 1.5(ECMAScript Version 3)的详细介绍。它还提供了W3C DOM标准(1级和2级)的完整内容,为了向后兼容,本书保持了遗留的O级DOM的资料...

    JavaScript权威指南

    JavaScript权威指南 犀牛书 Chapter 1. Introduction to JavaScript Section 1.1. JavaScript Myths Section 1.2. Versions of JavaScript Section 1.3. Client-Side JavaScript Section 1.4. JavaScript ...

    [removed] Moving to ES2015 (AZW3格式)

    Chapter 2. Functions, Closures, And Modules Chapter 3. Data Structures And Manipulation Chapter 4. Object-Oriented Javascript Chapter 5. Javascript Patterns Chapter 6. Testing And Debugging Chapter 7....

    Beginning.JavaScript.5th.Edition

    Beginning JavaScript, 5th Edition shows you how to work effectively with JavaScript frameworks, functions, and modern browsers, and teaches more effective coding practices using HTML5. This new ...

    JavaScript权威指南(第6版)

    Chapter 13 JavaScript in Web Browsers Chapter 14 The Window Object Chapter 15 Scripting Documents Chapter 16 Scripting CSS Chapter 17 Handling Events Chapter 18 Scripted HTTP Chapter 19 The jQuery ...

    Node.js.for.Embedded.Systems

    By bringing accessibility to embedded components such as sensors and microcontrollers, JavaScript and Node.js might shape the world of physical computing as they did for web browsers. This practical ...

    javascript权威指南(第六版)

    13. JavaScript in Web Browsers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307 13.1 Client-Side JavaScript 307 13.2 Embedding JavaScript in HTML 311 13.3 ...

    Professional JavaScript for Web Developers英文版

    the-fly graphicsJavaScript API changes in HTML5how browsers handle JavaScript errors and error handlingfeatures of JavaScript used to read and manipulate XML datathe JSON data format as an alternative...

    Mastering.JavaScript.High.Performance.1784397296

    Build faster and more proficient JavaScript programs for web browsers and hybrid mobile apps Step-by-step tutorial stuffed with real-world examples Who This Book Is For If you are a JavaScript ...

    Client-Side.Data.Storage.Keeping.It.Local.14919

    Chapter 2. Working with Cookies Chapter 3. Working with Web Storage Chapter 4. Working with IndexedDB Chapter 5. Working with Web SQL Chapter 6. Making It Easier with Libraries Chapter 7. Building a ...

    Beginning JavaScript 4th Edition Oct 2009

    You'll get all-new coverage of Ajax for remote scripting, JavaScript frameworks, JavaScript and XML, and the latest features in modern Web browsers. Plus, all the featured code has been updated to ...

    Mastering.JavaScript.1785281348

    The majority of websites employ JavaScript, and it is well supported by all modern web browsers without plugins. However, the JavaScript landscape has changed dramatically in recent years, and you ...

    Wrox.Professional.Website.Performance.2013

    Chapter 2. Utilizing Client-Side Caching Chapter 3. Content Compression Chapter 4. Keeping the Size Down with Minification Chapter 5. Optimizing Web Graphics and CSS Chapter 6. JavaScript, the ...

    Professional Mobile Web Development with WordPress, Joomla! and Drupal.pdf

    CHAPTER 2 A Technical Overview of the Mobile Web . . . . . . . . . . . . . . . . . . . . . . . . . 15 CHAPTER 3 Keeping Abreast of Developments . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

    Jump Start HTML5

    Chapter 2. Basics: The Anatomy of HTML5 Chapter 3. Basics: Structuring Documents Chapter 4. Basics: HTML5 Forms Chapter 5. Basics: Multimedia, Audio and Video Chapter 6. Multimedia: Preparing Your ...

    Web Browsers

    Web Browsers, A web browser is the software program you use to access the World Wide Web, the graphical portion of the Internet. The first browser, called NCSA Mosaic, was developed at the National ...

    ppk on Javascript (pdf)

    Chapter 2. Context Section A. The CSS revolution Section B. Separation of presentation and structure Section C. Separation of behavior and structure Section D. Separation of behavior and ...

Global site tag (gtag.js) - Google Analytics