来源于:http://book.learningjquery.com/3145/errata/

Chapter 1

page 14

The CSS snippet is correct, but it differs from the CSS in the sample download at packtpub.com. Visit book.learningjquery.com for the complete updated code download.

Chapter 2

page 29

The first paragraph reads:

Notice that the first <ul> has an ID of selecting plays

It should read:

Notice that the first <ul> has an ID of selected plays

Listing 2.2

Line 3 of Listing 2.2 reads:

  $('#selected-plays li:not(.horizontal)').addClass('sub-
level');li:not(.horizontal)').addClass('sub-level');

It should read:

  $('#selected-plays li:not(.horizontal)').addClass('sub-level');

Listing 2.5

Lines 5–7 of Listing 2.5 read:

      .addClass('henrylink');
});
});

Line 6 should be omitted, so the lines will just read:

      .addClass('henrylink');
});

page 46

The two code blocks incorrectely omit a space for the variable declaration. They begin:

varmyTag

They should begin:

var myTag

Chapter 3

no errata yet

Chapter 4

no errata yet

Chapter 5

no errata yet

Chapter 6

no errata yet

Chapter 7

no errata yet

Chapter 8

no errata yet

Chapter 9

Listing 9.8

The jQuery interface to the Sizzle selector engine changed in the late stages of the writing of this book, and the pseudo-selectors no longer receive the index of an element as one of their arguments. Instead, 0 is always passed as the variable, which causes our custom selector to break:


(function($) {
$.extend($.expr[':'], {
group: function(element, index, matches, set) {
var num = parseInt(matches[3], 10);
if (isNaN(num)) {
return false;
}
return index % (num * 2) < num;
}
});
})(jQuery);

A replacement function can be written that uses Sizzle’s setFilters capability:


(function($) {
$.expr.setFilters.group = function(elements, argument, not) {
var resultElements = [];
for (var i = 0; i < elements.length; i++) {
var test = i % (argument * 2) < argument;
if ((!not && test) || (not && !test)) {
resultElements.push(elements[i]);
}
}
return resultElements;
};
})(jQuery);

More information on setFilters can be found here: https://github.com/jquery/sizzle/wiki/Sizzle-Documentation#wiki-sizzleselectorssetfilterslowercase_name--function-elements-argument-not--

Chapter 10

no errata yet

Chapter 11

no errata yet

Learning jQuery, 4th Edition 勘误表的更多相关文章

  1. Professional JavaScript for Web Developers 4th Edition

    Professional JavaScript for Web Developers 4th Edition learning notes / 学习笔记 https://github.com/xgqf ...

  2. 《Algorithms 4th Edition》读书笔记——3.1 符号表(Elementary Symbol Tables)-Ⅳ

    3.1.4 无序链表中的顺序查找 符号表中使用的数据结构的一个简单选择是链表,每个结点存储一个键值对,如以下代码所示.get()的实现即为遍历链表,用equals()方法比较需被查找的键和每个节点中的 ...

  3. 《Algorithms 4th Edition》读书笔记——2.4 优先队列(priority queue)-Ⅶ(延伸:堆排序的实现)

    2.4.5 堆排序 我们可以把任意优先队列变成一种排序方法.将所有元素插入一个查找最小元素的有限队列,然后再重复调用删除最小元素的操作来将他们按顺序删去.用无序数组实现的优先队列这么做相当于进行一次插 ...

  4. 《Algorithms 4th Edition》读书笔记——2.4 优先队列(priority queue)-Ⅵ

    · 学后心得体会与部分习题实现 心得体会: 曾经只是了解了优先队列的基本性质,并会调用C++ STL库中的priority_queue以及 java.util.PriorityQueue<E&g ...

  5. 《Algorithms 4th Edition》读书笔记——2.4 优先队列(priority queue)-Ⅴ

    命题Q.对于一个含有N个元素的基于堆叠优先队列,插入元素操作只需要不超过(lgN + 1)次比较,删除最大元素的操作需要不超过2lgN次比较. 证明.由命题P可知,两种操作都需要在根节点和堆底之间移动 ...

  6. learning sql (second edition) script

    create database bank; use bank; /* begin table creation */ create table department (dept_id smallint ...

  7. 《Algorithms 4th Edition》读书笔记——3.1 符号表(Elementary Symbol Tables)-Ⅲ

    3.1.3 用例举例 在学习它的实现之前我们还是应该先看看如何使用它.相应的我们这里考察两个用例:一个用来跟踪算法在小规模输入下的行为测试用例和一个来寻找更高效的实现的性能测试用例. 3.1.3.1 ...

  8. 《Algorithms 4th Edition》读书笔记——3.1 符号表(Elementary Symbol Tables)-Ⅱ

    3.1.2 有序的符号表 典型的应用程序中,键都是Comparable的对象,因此可以使用a.compare(b)来比较a和b两个键.许多符号表的实现都利用Comparable接口带来的键的有序性来更 ...

  9. 《Algorithms 4th Edition》读书笔记——3.1 符号表(Elementary Symbol Tables)-Ⅰ

    3.1符号表 符号表最主要的目的就是将一个键和一个值联系起来.用例能够将一个键值对插入符号表并希望在之后能够从符号表的所有键值对中按照键值姐找到对应的值.要实现符号表,我们首先要定义其背后的数据结构, ...

随机推荐

  1. js实现打开网页自动弹出添加QQ好友邀请窗口

    我们有时进一些网面或专题页面会自动弹出一个加为好友的对话框了,在研究了很久之后发现可以直接使用js来实现,下面我们一起来看js实现打开网页自动弹出添加QQ好友邀请窗口的方法. 第一步.JS脚本 这个是 ...

  2. .NET导入导出Excel

    若是开发后台系统,ASP.NET MVC中总是涉及了很多导入导出Excel的问题,有的时候处理起来比较烦 如果能使用以下代码解决,就完美了 public class ReportModel { [Ex ...

  3. [转]Oracle 分组聚合二种写法,listagg和wmsys.wm_concat

    本文转自:http://www.cnblogs.com/ycdx2001/p/3502495.html with temp as( select 'China' nation ,'Guangzhou' ...

  4. [转]android 获取视频帧

    本文转自:http://blog.csdn.net/heart_Moving/article/details/17414067 今天做Android视频文件解码,需求:从一个视频文件获取到一帧一帧的图 ...

  5. 32-bit ALU [Verilog]

    Based on MIPS Instruction Structure Main Module module Alu( input [31:0] a, // operand 1 input [31:0 ...

  6. NGUI Label Color Code

    UILabel的颜色代码 NGUI的Label文档:http://www.tasharen.com/?page_id=166 you can embed colors in [RrGgBb] form ...

  7. SQL主外键和子查询

    主键 数据库主键是指表中一个列或列的组合,其值能唯一地标识表中的每一行.这样的一列或多列称为表的主键,通过它可强制表的实体完整性.当创建或更改表时可通过定义 PRIMARY KEY约束来创建主键.一个 ...

  8. u3d_shader_surface_shader_4

    Rim Lighting  轮廓自发光 一:疑问:1.总感觉在编辑器Scene状态下,脚本计算的ViewDir是我漫游的Cam,而不是项目中的MainCam啊! 然后就会造成Scene状态下轮廓自发光 ...

  9. 一类有依赖的树形背包dp方法

    失踪人口回归系列 这个标题是不是看起来很厉害呢233 给一道例题:有一个树,每一个节点代表一个物品,每个物品有重量和价值,每个物品必须先选父亲才能选自己.求给定重量内最大价值. 这题的思路十分的厉害. ...

  10. dubbo2.5.3 与spring 3.1.x 冲突

    在集成了dubbo2.5.3 的项目中初始化出现 MalformedParameterizedTypeException 检查发现这是因为dubbo2.5.3依赖的springframeworks是2 ...