Secrets of the JavaScript Ninja

John Resig, Bear Bibeault

出版时间

2013-01-17

ISBN

9781933988696

评分

★★★★★
书籍介绍
这是一本把 JavaScript「底层机制」讲透的书,而非教你如何使用某个框架。它由 jQuery 作者 John Resig 等人撰写,核心在于揭示函数、闭包、作用域与 this 指向这些被多数人一带而过的概念,并展示如何像忍者一样灵活运用它们。书中大量涉及跨浏览器兼容性的坑——从 typeof 在不同浏览器中的诡异表现,到 iframe 函数的类型误判,几乎把前端开发者踩过的雷都覆盖了一遍。读者反馈显示,读完最直接的收获是「看懂了 jQuery 到底为什么出现、它的代码为何那样写」,从而从「会用库」进阶到「理解库」。它适合愿意啃代码、追求知其所以然的前端开发者,尤其是对函数式编程、闭包与调试有钻研兴趣的人。
AI导读
核心看点
  • 深入解析函数、闭包及原型链,揭示JS核心机制
  • 详解跨浏览器兼容性与调试技巧,提升工程能力
  • 剖析jQuery设计思想,理解库背后的实现原理
读者共识
  • 作者John Resig代码风格灵活,展现对JS的极致热爱
  • 函数式编程与闭包章节讲解精彩,是全书精华所在
  • 虽有小瑕疵,但被公认为深入理解JS的必读经典之作
精彩摘录
  • "all morden browsers but IE"
  • "In order to be a good JavaScript developer you need to maintain the traits that most good programmers have including testing, performance analysis, anddebugging."
  • "• Firebug: The popular developer extension for Firefox http://getfirebug.org/ • IE Developer Tools: Included in Internet Explorer 8. • Opera Dragonfly: Included in Opera 9.5 and newer - also works with Mobile versions of Opera. • Safari Developer Tools: Introduced in Safari 3 and dramatically improv"
  • "• Firefox 2 and 3: Doing a typeof on the HTML <object/> element yields an inaccurate "function" result (instead of "object"), like so: typeof objectElem == "function". • Firefox 2: A little known feature: You can call regular expressions as if they were functions, like so: /test/("a test"). This can"
  • "For example, most JavaScript libraries end up supporting about 12 browser: The previous release, the current release, and the upcoming release of Internet Explorer, Firefox, Safari, and Opera."
  • "To start, it's important to realize what that the function context represents: The object within which the function is being executed."
  • "The two methods are quite similar to each other, as to how they're used, but with a distinction: How they set incoming argument values. Simply, .call() passes in arguments individually whereas .apply() passes in arguments as an array, as shown in Listing 2-20."
  • "A couple important aspect, to take note of, in this example. We're accessing a native object method (Array.prototype.push) and are treating it just like any other function or method - by using .call(). The most interesting part is the use of 'this' as the context. Normally, since a push method is pa"
用户评论
明明写的是Ninja,封面配图却是Samurai。呸,瞧不起毫无考据精神的你们!
太高深,而且是英文版,看不懂。
Javascript, a dialect of Lisp which is not correctly implemented
看了MEAP版本后终于看了正式版,里面大量的更新,总之,值得等待,配合good parts应该就差不多了
meap edition. 赶在正式出版前看完... 看这种前面是代码后面是解释的书的结果就是,把代码看完了,后面的文字都不想看了,要是说明直接用注释写出来多好啊。。。(后面几章涉及兼容性的看得很痛苦,跟每次大号最后想还把残留的东西再挤出来的感觉一样的)
看了三分之一左右。有很多细节和技巧,适合哪天把Javascript作为主力开发工具的时候,再拿来细细啃。相关的书籍有: https://book.douban.com/subject/26382780/ https://book.douban.com/subject/26854244/
没做笔记,看来要重读
大神之作
上学的时候读过一次,当时挺多不懂的,最近又买了一本,真是满满的黑科技感。
JavaScript忍者秘籍
下载
收藏