jQuery in easy steps
eBook - ePub

jQuery in easy steps

  1. English
  2. ePUB (mobile friendly)
  3. Available on iOS & Android
eBook - ePub

jQuery in easy steps

About this book

jQuery in Easy Steps begins by explaining how to incorporate the free jQuery library so readers can quickly create interactive web page features by copying the book's examples. It demonstrates how to easily select elements of the web page for manipulation and how to simply produce dynamic responses to user events. Examples illustrate various exciting animation effects and how to employ the power of AJAX to load external data without refreshing the entire web page. The book concludes by demonstrating how readers can use their acquired knowledge to create their very own distributable plugins for the jQuery library. jQuery in Easy Steps assumes readers will already have some basic knowledge of HTML, CSS, and JavaScript and are now ready to embrace the jQuery philosophy of "write less - do more" to enhance their web pages. It has an easy-to-follow style that will appeal to web developers who want to quickly learn the latest dynamic techniques, and to the student who is studying website design at school or college, and to those seeking a career in web development that need a thorough understanding of jQuery.

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access jQuery in easy steps by Mike McGrath in PDF and/or ePUB format, as well as other popular books in Computer Science & Web Programming. We have over one million books available in our catalogue for you to explore.
5
Recognizing events
This chapter demonstrates how to create event-handler functions that provide responses to user actions.


Detecting clicks
When the user clicks, or taps, on an element in a jQuery object a “click event” occurs that can be recognized by that object’s click() method. Similarly, when the user makes a double-click on the element a “dblclick event” occurs that can be recognized by that object’s dblclick() method. An anonymous function argument can be specified to each method to provide a response to each event:

205831.webp
click.html

Screen Shot 2013-04-18 at 11.46.31
Add a division to the body of an HTML document
Screen Shot 2014-03-13 at 13.30.57

Screen Shot 2013-04-18 at 11.46.42
In the head section of the HTML document add a style sheet to specify initial rules for the division
Screen Shot 2014-03-13 at 13.31.03

Screen Shot 2013-04-18 at 11.46.50
Next, in the head section of the document, add a script block that specifies event-handlers for each click event
Screen Shot 2014-03-13 at 13.31.08

Screen Shot 2013-04-18 at 11.46.59
Save the document alongside the jQuery library file then open it in a browser and click the division to see response
080-1_click_.tif

080-2_dblclick_.tif

187104.webp
The css() and text() methods could be chained together here in a single statement with $( this ).css(...).text(...);.
The “click event” of an element in a jQuery object can be fired from the script by calling that object’s trigger() method and specifying the event name (within quote marks) as its argument. This will execute the statements within that event’s nomin...

Table of contents

  1. Getting started
  2. Performing actions
  3. Managing forms
  4. Manipulating elements
  5. Recognizing events
  6. Attaching handles
  7. Producing effects
  8. Employing AJAX
  9. Using plugins
  10. Handy reference