楼主: Lisrelchen
1181 8

Learning jQuery 4th Edition [推广有奖]

  • 0关注
  • 62粉丝

VIP

院士

67%

还不是VIP/贵宾

-

TA的文库  其他...

Bayesian NewOccidental

Spatial Data Analysis

东西方数据挖掘

威望
0
论坛币
49957 个
通用积分
79.5487
学术水平
253 点
热心指数
300 点
信用等级
208 点
经验
41518 点
帖子
3256
精华
14
在线时间
766 小时
注册时间
2006-5-4
最后登录
2022-11-6

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币


  • Learning jQuery - Fourth Edition
  • By: Jonathan Chaffer; Karl Swedberg

  • Publisher: Packt Publishing

  • Pub. Date: June 25, 2013

  • Print ISBN-13: 978-1-78216-314-5

  • Web ISBN-13: 978-1-78216-315-2

  • Pages in Print Edition: 444

  • Subscriber Rating: [1 Rating]




二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Learning Edition earning dition Jquery

本帖被以下文库推荐

沙发
Lisrelchen 发表于 2015-10-18 03:05:41 |只看作者 |坛友微信交流群
  1. What this book covers

  2. Chapter 1, Getting Started, will get your feet wet with the jQuery JavaScript library. The chapter begins with a description of jQuery and what it can do for you. It then walks you through downloading and setting up the library, as well as writing your first script.

  3. Chapter 2, Selecting Elements, will teach how to use jQuery's selector expressions and DOM traversal methods to find elements on the page, wherever they may be. You'll use jQuery to apply styling to a diverse set of page elements, sometimes in a way that pure CSS cannot.

  4. Chapter 3, Handling Events, will walk you through jQuery's event-handling mechanism to fire off behaviors when browser events occur. You'll see how jQuery makes it easy to attach events to elements unobtrusively, even before the page finishes loading. Also, you'll get an overview of deeper topics, such as event bubbling, delegation, and namespacing.

  5. Chapter 4, Styling and Animating, will introduce you to jQuery's animation techniques and how to hide, show, and move page elements with effects that are both useful and pleasing to the eye.

  6. Chapter 5, Manipulating the DOM, will teach you how to change your page on command. This chapter will also teach you how to alter the very structure of an HTML document, as well as adding to its content on the fly.

  7. Chapter 6, Sending Data with Ajax, will walk you through many ways in which jQuery makes it easy to access server-side functionality without resorting to clunky page refreshes. With the basic components of the library well in hand, you will be ready to explore how the library can expand to fit your needs.

  8. Chapter 7, Using Plugins, will show you how to find, install, and use plugins, including the powerful jQuery UI and jQuery Mobile plugin libraries.

  9. Chapter 8, Developing Plugins, will teach you how to take advantage of jQuery's impressive extension capabilities to develop your own plugins from the ground up. You'll create your own utility functions, add jQuery object methods, and discover the jQuery UI widget factory. Next, you'll take a second tour through jQuery's building blocks, learning more advanced techniques.

  10. Chapter 9, Advanced Selectors and Traversing, will refine your knowledge of selectors and traversals, gaining the ability to optimize selectors for performance, manipulate the DOM element stack, and write plugins that expand selecting and traversing capabilities.

  11. Chapter 10, Advanced Events, will dive further into techniques such as delegation and throttling that can greatly improve event-handling performance. You'll also create custom and special events that add even more capabilities to the jQuery library.

  12. Chapter 11, Advanced Effects, will fine-tune the visual effects of jQuery that can be provided by crafting custom-easing functions and reacting to each step of an animation. You'll gain the ability to manipulate animations as they occur and schedule actions with custom queuing.

  13. Chapter 12, Advanced DOM Manipulation, will provide you with more practice modifying the DOM with techniques such as attaching arbitrary data to elements. You'll also learn how to extend the way jQuery processes CSS properties on elements.

  14. Chapter 13, Advanced Ajax, will help you achieve a greater understanding of Ajax transactions, including the jQuery deferred object system for handling data that may become available at a later time.

  15. Appendix A, JavaScript Closures, will help you gain a solid understanding of closures in JavaScript—what they are and how you can use them to your advantage.

  16. Appendix B, Testing JavaScript with QUnit, will teach you about the QUnit library for unit testing of JavaScript programs. This library will add to your toolkit for developing and maintaining highly sophisticated web applications.

  17. Appendix C, Quick Reference, will provide a glimpse of the entire jQuery library, including every one of its methods and selector expressions. Its easy-to-scan format is perfect for those moments when you know what you want to do, but you're just unsure about the right method name or selector.
复制代码

使用道具

藤椅
Lisrelchen 发表于 2015-10-18 03:07:09 |只看作者 |坛友微信交流群
  1. What jQuery does

  2. The jQuery library provides a general-purpose abstraction layer for common web scripting, and is therefore useful in almost every scripting situation. Its extensible nature means that we could never cover all the possible uses and functions in a single book, as plugins are constantly being developed to add new abilities. The core features, though, assist us in accomplishing the following tasks:

  3. Access elements in a document: Without a JavaScript library, web developers often need to write many lines of code to traverse the Document Object Model (DOM) tree and locate specific portions of an HTML document's structure. With jQuery, developers have a robust and efficient selector mechanism at their disposal, making it easy to retrieve the exact piece of the document that needs to be inspected or manipulated.
  4. $('div.content').find('p');
  5. Modify the appearance of a web page: CSS offers a powerful method of influencing the way a document is rendered, but it falls short when not all web browsers support the same standards. With jQuery, developers can bridge this gap, relying on the same standards support across all browsers In addition, jQuery can change the classes or individual style properties applied to a portion of the document even after the page has been rendered.
  6. $('ul > li:first').addClass('active');
  7. Alter the content of a document: Not limited to mere cosmetic changes, jQuery can modify the content of a document itself with a few keystrokes. Text can be changed, images can be inserted or swapped, lists can be reordered, or the entire structure of the HTML can be rewritten and extended—all with a single easy-to-use Application Programming Interface (API).
  8. $('#container').append('<a href="more.html">more</a>');
  9. Respond to a user's interaction: Even the most elaborate and powerful behaviors are not useful if we can't control when they take place. The jQuery library offers an elegant way to intercept a wide variety of events, such as a user clicking on a link, without the need to clutter the HTML code itself with event handlers. At the same time, its event-handling API removes browser inconsistencies that often plague web developers.
  10. $('button.show-details').click(function() {
  11.   $('div.details').show();
  12. });
  13. Animate changes being made to a document: To effectively implement such interactive behaviors, a designer must also provide visual feedback to the user. The jQuery library facilitates this by providing an array of effects such as fades and wipes, as well as a toolkit for crafting new ones.
  14. $('div.details').slideDown();
  15. Retrieve information from a server without refreshing a page: This code pattern is known as Ajax, which originally stood for Asynchronous JavaScript and XML, but has since come to represent a much greater set of technologies for communicating between the client and the server. The jQuery library removes the browser-specific complexity from this responsive, feature-rich process, allowing developers to focus on the server-end functionality.
  16. $('div.details').load('more.html #content');
  17. Simplify common JavaScript tasks: In addition to all of the document-specific features of jQuery, the library provides enhancements to basic JavaScript constructs such as iteration and array manipulation.
  18. $.each(obj, function(key, value) {
  19.   total += value;
  20. });
复制代码

使用道具

板凳
Lisrelchen 发表于 2015-10-18 03:07:58 |只看作者 |坛友微信交流群
  1. Why jQuery works well

  2. With the resurgence of interest in dynamic HTML comes a proliferation of JavaScript frameworks. Some are specialized, focusing on just one or two of the tasks previously mentioned. Others attempt to catalog every possible behavior and animation and serve these all up prepackaged. To maintain the wide range of features outlined earlier while remaining relatively compact, jQuery employs several strategies:

  3. Leverage knowledge of CSS: By basing the mechanism for locating page elements on CSS selectors, jQuery inherits a terse yet legible way of expressing a document's structure. The jQuery library becomes an entry point for designers who want to add behaviors to their pages, because a prerequisite for doing professional web development is knowledge of CSS syntax.
  4. Support extensions: In order to avoid "feature creep", jQuery relegates special-case uses to plugins. The method for creating new plugins is simple and well-documented, which has spurred the development of a wide variety of inventive and useful modules. Even most of the features in the basic jQuery download are internally realized through the plugin architecture, and can be removed if desired, yielding an even smaller library.
  5. Abstract away browser quirks: An unfortunate reality of web development is that each browser has its own set of deviations from published standards. A significant portion of any web application can be relegated to handling features differently on each platform. While the ever-evolving browser landscape makes a perfectly browser-neutral code base impossible for some advanced features, jQuery adds an abstraction layer that normalizes the common tasks, reducing the size of code while tremendously simplifying it.
  6. Always work with sets: When we instruct jQuery to find all elements with the class collapsible and hide them, there is no need to loop through each returned element. Instead, methods such as .hide() are designed to automatically work on sets of objects instead of individual ones. This technique, called implicit iteration, means that many looping constructs become unnecessary, shortening code considerably.
  7. Allow multiple actions in one line: To avoid overuse of temporary variables or wasteful repetition, jQuery employs a programming pattern called chaining for the majority of its methods. This means that the result of most operations on an object is the object itself, ready for the next action to be applied to it.
复制代码

使用道具

报纸
Lisrelchen 发表于 2015-10-18 03:09:44 |只看作者 |坛友微信交流群
  1. Understanding the DOM

  2. One of the most powerful aspects of jQuery is its ability to make selecting elements in the DOM easy. The DOM serves as the interface between JavaScript and a web page; it provides a representation of the source HTML as a network of objects rather than as plain text.

  3. This network takes the form of a family tree of elements on the page. When we refer to the relationships that elements have with one another, we use the same terminology that we use when referring to family relationships: parents, children, and so on. A simple example can help us understand how the family tree metaphor applies to a document:

  4. <html>
  5.   <head>
  6.     <title>the title</title>
  7.   </head>
  8.   <body>
  9.     <div>
  10.       <p>This is a paragraph.</p>
  11.       <p>This is another paragraph.</p>
  12.       <p>This is yet another paragraph.</p>
  13.     </div>
  14.   </body>
  15. </html>
复制代码

使用道具

地板
Lisrelchen 发表于 2015-10-18 03:11:04 |只看作者 |坛友微信交流群

CSS Selectors

  1. To begin learning how jQuery works with CSS selectors, we'll use a structure that appears on many websites, often for navigation – the nested unordered list:

  2. <ul id="selected-plays">
  3.   <li>Comedies
  4.     <ul>
  5.       <li><a href="/asyoulikeit/">As You Like It</a></li>
  6.       <li>All's Well That Ends Well</li>
  7.       <li>A Midsummer Night's Dream</li>
  8.       <li>Twelfth Night</li>
  9.     </ul>
  10.   </li>
  11.   <li>Tragedies
  12.     <ul>
  13.       <li><a href="hamlet.pdf">Hamlet</a></li>
  14.       <li>Macbeth</li>
  15.       <li>Romeo and Juliet</li>
  16.     </ul>
  17.   </li>
  18.   <li>Histories
  19.     <ul>
  20.       <li>Henry IV (<a href="mailto:henryiv@king.co.uk">email</a>)
  21.          <ul>
  22.            <li>Part I</li>
  23.            <li>Part II</li>
  24.          </ul>
  25.       <li><a href="http://www.shakespeare.co.uk/henryv.htm">
  26.                                                    Henry V</a></li>
  27.       <li>Richard II</li>
  28.     </ul>
  29.   </li>
  30. </ul>
复制代码

使用道具

7
Lisrelchen 发表于 2015-10-18 03:13:48 |只看作者 |坛友微信交流群
  1. Attribute Selectors
  2. $(document).ready(function() {
  3.   $('a[href^="mailto:"]').addClass('mailto');
  4.   $('a[href$=".pdf"]').addClass('pdflink');
  5.   $('a[href^="http"][href*="henry"]')
  6.     .addClass('henrylink');
  7.   });
  8. });
复制代码

使用道具

8
Lisrelchen 发表于 2015-10-18 03:16:40 |只看作者 |坛友微信交流群
  1. Finding elements based on textual content
  2. For one final custom-selector touch, let's suppose for some reason we want to highlight any table cell that referred to one of the Henry plays. All we have to do—after adding a class to the stylesheet to make the text bold and italicized ( .highlight {font-weight:bold; font-style: italic;} )—is add a line to our jQuery code using the :contains() selector:

  3. $(document).ready(function() {
  4.   $('tr:nth-child(odd)').addClass('alt');
  5.   $('td:contains(Henry)').addClass('highlight');
  6. });
复制代码

使用道具

9
franky_sas 发表于 2016-12-20 14:49:45 |只看作者 |坛友微信交流群

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-5-1 12:22