jQuery in easy steps
eBook - ePub

jQuery in easy steps

Mike McGrath

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

jQuery in easy steps

Mike McGrath

Book details
Book preview
Table of contents
Citations

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

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
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.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
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.
Do you support text-to-speech?
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.
Is jQuery in easy steps an online PDF/ePUB?
Yes, you can access jQuery in easy steps by Mike McGrath in PDF and/or ePUB format, as well as other popular books in Ciencia de la computación & Programación web. We have over one million books available in our catalogue for you to explore.

Information

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

Citation styles for jQuery in easy steps

APA 6 Citation

McGrath, M. (2014). jQuery in easy steps ([edition unavailable]). In Easy Steps Limited. Retrieved from https://www.perlego.com/book/3016372/jquery-in-easy-steps-pdf (Original work published 2014)

Chicago Citation

McGrath, Mike. (2014) 2014. JQuery in Easy Steps. [Edition unavailable]. In Easy Steps Limited. https://www.perlego.com/book/3016372/jquery-in-easy-steps-pdf.

Harvard Citation

McGrath, M. (2014) jQuery in easy steps. [edition unavailable]. In Easy Steps Limited. Available at: https://www.perlego.com/book/3016372/jquery-in-easy-steps-pdf (Accessed: 15 October 2022).

MLA 7 Citation

McGrath, Mike. JQuery in Easy Steps. [edition unavailable]. In Easy Steps Limited, 2014. Web. 15 Oct. 2022.