{"id":314,"date":"2013-10-07T17:55:07","date_gmt":"2013-10-07T17:55:07","guid":{"rendered":"http:\/\/ruirib.net\/blog\/?p=314"},"modified":"2013-11-05T14:35:12","modified_gmt":"2013-11-05T14:35:12","slug":"book-review-jquery-succinctly","status":"publish","type":"post","link":"https:\/\/ruirib.net\/index.php\/2013\/10\/book-review-jquery-succinctly\/","title":{"rendered":"Book review: jQuery Succinctly"},"content":{"rendered":"<style type=\"text\/css\"><\/style><p><a href=\"http:\/\/www.syncfusion.com\/resources\/techportal\/ebooks\/jquery?UTM_medium=ruiblogreview\"><img loading=\"lazy\" decoding=\"async\" class=\"size-thumbnail wp-image-315 aligncenter\" alt=\"jquery_succinctly_download\" src=\"http:\/\/ruirib.net\/wp-content\/uploads\/2013\/10\/jquery_succinctly_download-150x150.png\" width=\"150\" height=\"150\" \/><\/a><\/p>\r\n<p>&nbsp;<\/p>\r\n<ol>\r\n<li><span style=\"font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; font-style: inherit; font-weight: bold; line-height: 1.625;\">Introduction<\/span><br \/> For developers, there is a need to keep up to date with the latest technologies, in a rapidly changing landscape. While the internet does allow for easier access to information resources, the truth is that there is probably nothing like a good book to provide a structured approach to a given technology. With a book, readers can benefit from the author&#8217;s experience and knowledge right from the beginning, and can be given a guided tour that makes learning probably a lot easier than going through a series of website articles.\r\n<p>Recently I became aware of a series of free books made available by Syncfusion. I am sucker for books, so I downloaded a few, relevant to some of the technologies I use, to check them. One of those books is the subject of this review &#8211; <a href=\"http:\/\/www.syncfusion.com\/resources\/techportal\/ebooks\/jquery?UTM_medium=ruiblogreview\">jQuery Succinctly<\/a>. The book author is Cody Lindley, described in the book as having been a jQuery evangelist with the jQuery team.<\/p>\r\n<p>jQuery is one of the technologies that powers the Web, these days. In most websites with a great user experience, most certainly jQuery is used to provide&nbsp;such experience. So my goal on reviewing this book is to evaluate it as a useful resource for someone wanting to how to use it for website development.<\/p>\r\n<\/li>\r\n<li>\r\n<h2>Book Structure<\/h2>\r\n<p>The book is organized in 10 chapters, starting with <strong>Core jQuery<\/strong> and including chapters such as <strong>Selecting<\/strong>, <strong>Traversing<\/strong>, <strong>Manipulation<\/strong>, <strong>HTML Forms<\/strong>, <strong>Events<\/strong>, <strong>jQuery and the web browser<\/strong>, <strong>Plugins<\/strong>, <strong>Effects<\/strong> and <strong>Ajax<\/strong>. This seems a decent coverage of the subjects related to jQuery to allow any developer to use it effectively for website development. The presentation is supported by examples, that are usually well chosen and helpful. The code can be downloaded, making it easier to follow the examples as the reading proceeds.<\/p>\r\n<p>&nbsp;Chapter 1, <strong>Core jQuery<\/strong>, introduces the reader to the core concepts of jQuery &#8211; in the words of the author, &#8220;find something, do something&#8221;, that is then extended to &#8220;create something, select it and do something with it&#8221;. This chapter also deals with other relevant introductory aspects like dealing with the wait for the DOM to be parsed or waiting for the full window to load, jQuery chaining, jQuery methods that break the chain and how recovery from such destruction can be achieved using <em>end()<\/em>. It also introduces the <em>this<\/em> keyword, iterating over multiple selected elements using <em>.each()<\/em>, accessing selected elements by index using <em>get()<\/em> and creating DOM elements. The chapter provides a decent introduction to all these subjects, even if in a rather brief&nbsp;way.&nbsp;<\/p>\r\n<p>Chapter 2, <strong>Selecting<\/strong> is devoted to DOM elements selection. It starts with a presentation of filters or, as some other authors name them, jQuery type extension selectors. The <em>is()<\/em> method, to determine if a given element is present in the selected set of elements and the <em>length<\/em> property,&nbsp;are presented. The chapter also shows how custom selectors (filters) can be created, when jQuery does not provide the selectors you may need. A decent presentation of selectors that explore relationships between elements follows, as well as selector stacking and nesting. I found the chapter quite interesting and it did cover some selection techniques I hadn&#8217;t found in other jQuery books I read before.<\/p>\r\n<p><strong>Traversing<\/strong> is the 3rd book chapter, dedicated to DOM traversing. Strangely it starts with the <em>filter()<\/em> and <em>find()<\/em> methods, which probably would make more sense in the previous chapter. The coverage is succinctly good. The DOM traversing methods <em>parent()<\/em>, <em>parents()<\/em>, <em>closest()<\/em> are introduced and differences explained. Other traversing methods are also briefly addressed.<\/p>\r\n<p>Chapter 4, <strong>Manipulation<\/strong>, addresses the creation, operation and addition of HTML, using jQuery. HTML creation is exemplified as is the addition of such HTML to the DOM using <em>appendTo()<\/em>. The <em>Index()<\/em>&nbsp;method and why you&#8217;d use it is also presented. The use of <em>text()<\/em> and other methods such as <em>replace()<\/em>, <em>contents()<\/em> or <em>remove()<\/em> are exemplified.<\/p>\r\n<p>Chapter 5, <strong>HTML Forms<\/strong>, presents jQuery features to handle HTML forms. The <em>attr()<\/em> and <em>removeAttr()<\/em> methods to change or disable form elements, as well as the use of filter attributes such as <em>:enabled<\/em> and <em>:disabled<\/em>. Radio and checkbox selection and checking is exemplified, using <em>val()<\/em> and filter attributes such as <em>:checked<\/em> or :<em>hidden<\/em>. Use of <em>val()<\/em> to set the value of input elements and <em>&lt;text<strong><\/strong>area&gt;<\/em> is presented. Multiple examples are given of common tasks of elements edition, using methods such as <em>prepend()<\/em>, <em>html() or&nbsp;replacewith()<\/em>. Form elements selection by type is demonstrated through examples. Overall, the chapter is a good read but, similar to what I found regarding Ajax as a general subject, it is a shame that Ajax form submission&nbsp;is not covered.<\/p>\r\n<p>Chapter 6 deals with <strong>Events<\/strong>. Dealing with events is one of the most important features of jQuery and the chapter covers the subject nicely. It starts with an explanation about how there can be multiple <em>ready()<\/em> events declared. It then addresses the use of <em>bind()<\/em> and <em>unbind()<\/em> with multiple handlers. It also shows how event handlers can be invoked through short methods and addresses the event normalization performed by jQuery, showing how access to the normalized event can be achieved. Event namespacing advantages, and how namespacing can be achieved, are presented. Event delegation is introduced and its advantages are highlighted. The use of <em>live()<\/em> to bind event handlers that will be applied even to DOM elements created after the binding is perform is also shown and the methods specificities are explained. Preventing the browser from taking default behaviors or stopping event propagation, using <em>stopPropagation<\/em>&nbsp;or using <em>return false<\/em>, when opening a link or submitting a form is also addressed. The creation of custom events using <em>bind<\/em> and their invocation using <em>trigger<\/em> is also presented, as is cloning events using <em>clone<\/em>. I found this to be a very interesting chapter, addressing most situations a developer may need regarding event handling.<\/p>\r\n<p>Chapter 7, <strong>jQuery and the browser<\/strong>, is a bit of a weird one. It covers two small subjects only &#8211; disabling the right click button and scrolling the browser window. In its succinctness, it&#8217;s pretty similar to chapter 10 and I confess I fail to see the point of having a chapter with such small amount of content.<\/p>\r\n<p>Chapter 8 addresses <strong>Plugins<\/strong>. It starts with the recommendation to use the $ alias only within a private scope to avoid conflicts and the way to do that is demonstrated. The use of <em>$.fn<\/em> to make plugin methods chainable, just as jQuery native methods, is explained and exemplified. Default and custom plugin options are presented. Programmatic invocation of plugins is addressed. Although useful and addressing relevant contents related to the subject, a reference to utility functions could have been made, even if succinctly.<\/p>\r\n<p>Chapter 9 deals with <strong>Effects<\/strong>. This chapter starts in a bit of a weird manner. The first statement is that all jQuery animation effects can be disabled by setting the value of the <em>off<\/em> property to <em>true<\/em>. If you consider that the book may be read by someone who never used jQuery&#8217;s animation effects, this introduction may actually lack some context. The text proceeds in the same tone by stating that the <em>stop()<\/em> method should be used to stop an ongoing animation, before starting a new one. The rest of the chapter discusses the use of <em>show()<\/em>, <em>hide()<\/em> and <em>toggle()<\/em> without animation. Exemplifies sequential and non sequential animations, using <em>animate()<\/em>. Presents it as a base abstraction and offers detailed suggestions on how it can be used. The chapter also presents jQuery&#8217;s fading methods, <em>fadeIn()<\/em>, <em>fadeout()<\/em> and <em>fadeTo()<\/em>.&nbsp;<\/p>\r\n<p>Chapter 10, <strong>Ajax<\/strong>, address jQuery Ajax related features. I found this chapter a bit disappointing. It basically presents the <em>$.ajax()<\/em>&nbsp;function as the low level abstraction by the shortcut methods load(), get(), getJSON(), getScript(), and post(), but without actually providing examples of their use. There is another additional paragraph stating that jQuery supports cross-domain JSONP and shows how browser XHR requests caching can be disabled &#8211; this is a piece of actually useful info, much to the contrary of the rest of the chapter.<\/p>\r\n<\/li>\r\n<li><strong>Conclusion<\/strong>\r\n<p>The author states, in the book introduction, that the book was written to express the concepts essential to intermediate and advanced jQuery development, with each chapter containing concepts essential to becoming a jQuery developer. I confess I didn&#8217;t really look at it under this perspective. Although maybe a bit unfairly, I suspect, considering Syncfusion&#8217;s audience, that it will be used, at least in a relevant part, by developers fluent in Microsoft&#8217;s web technologies, to become familiar with jQuery, to use it in the development of websites. So, from a web developer&#8217;s point of view, I found the book rather useful, with some very good chapters (2, 5 and 6 are my favorites) and others not as good (especially 7 and 10). Even if some chapters could benefit from a bit better coverage of the underlying subjects or a better organization, the book can be a valuable resource.&nbsp;All the subjects are dealt with in a succinct manner, which is the purpose of the <a href=\"http:\/\/www.syncfusion.com\/resources\/techportal\/ebooks?UTM_medium=ruiblogreview\">Syncfusion ebook series<\/a>, anyway, which means it cannot probably be the single book to have on jQuery, but it does provide some valuable information and you can&#8217;t beat the cost. It is also a book that you can keep nearby, to be used as a reference. I will keep my copy within easy reach.<\/p>\r\n<\/li>\r\n<\/ol>\r\n<p>&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"&nbsp; Introduction For developers, there is a need to keep up to date with the latest technologies, in a rapidly changing landscape. While the internet does allow for easier access to information resources, the truth is that there is probably nothing like a good book to provide a structured approach to a given technology. With&#8230;","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[91,77],"tags":[93,92],"class_list":["post-314","post","type-post","status-publish","format-standard","hentry","category-book-reviews","category-web-development","tag-javascript","tag-jquery"],"_links":{"self":[{"href":"https:\/\/ruirib.net\/index.php\/wp-json\/wp\/v2\/posts\/314","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ruirib.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ruirib.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ruirib.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ruirib.net\/index.php\/wp-json\/wp\/v2\/comments?post=314"}],"version-history":[{"count":39,"href":"https:\/\/ruirib.net\/index.php\/wp-json\/wp\/v2\/posts\/314\/revisions"}],"predecessor-version":[{"id":520,"href":"https:\/\/ruirib.net\/index.php\/wp-json\/wp\/v2\/posts\/314\/revisions\/520"}],"wp:attachment":[{"href":"https:\/\/ruirib.net\/index.php\/wp-json\/wp\/v2\/media?parent=314"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ruirib.net\/index.php\/wp-json\/wp\/v2\/categories?post=314"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ruirib.net\/index.php\/wp-json\/wp\/v2\/tags?post=314"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}