博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Learning jQuery, 4th Edition 勘误表
阅读量:6700 次
发布时间:2019-06-25

本文共 2239 字,大约阅读时间需要 7 分钟。

来源于: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  for the complete updated .

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

转载地址:http://oqloo.baihongyu.com/

你可能感兴趣的文章
vim命令练习题。
查看>>
node.js Websocket消息推送---GoEasy
查看>>
6000个边缘Kubernetes节点驱动城市80万次智能停车,如何成为可能?
查看>>
(八)企业部分之nginx+tomcat+memcached负载均衡集群搭建
查看>>
图片格式转换工具与方法
查看>>
MySQL/sqlserver查询in操作 查询结果按in集合顺序显示
查看>>
如何使用Android Studio把自己的Android library分享到jCenter和Maven Central
查看>>
优美的配色方案设计
查看>>
设计模式——原型模式
查看>>
CSS——基础选择器
查看>>
App性能优化之内存优化
查看>>
Linux 灾难恢复 Linux 系统启动故障修复
查看>>
修复./mysql/proc
查看>>
快速地创建快顶尖的医学图像处理控件ImageGear Medical
查看>>
JSP注释方法
查看>>
Silverlight实用窍门系列:63.Silverlight中的Command,自定义简单Command
查看>>
LVS
查看>>
从软件交付看软件验收管理
查看>>
centos7 mysql数据库安装和配置
查看>>
Redis数据类型:字符串
查看>>