Introduction To JQuery

Reviews
Shared by: jonathan Scott
Stats
views:
86
rating:
not rated
reviews:
0
posted:
5/30/2009
language:
English
pages:
0
FUN WITH JQUERY Javascript development for the rest of us What is JQuery? According to their site: jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript. In simple terms, JQuery is a Javascript framework that has many built-in functionalities to allow us to easily incorporate interactivity between our files and the user. Using it effectively reduces development time. A little background Developed by John Resiq of Mozilla http://ejohn.org jQuery was first announced at BarCamp NYC in 2006. The growth of jQuery has exploded. They now have a team of developers working on jQuery including a UI team, Documentation Team, etc. Both Microsoft and Nokia have announced they will be incorporating jQuery in their systems. Why use JQuery? Reduction in development time. JQuery is: •Lightweight. •CSS3 compliant. •Cross-browser compatible: IE 6+, FireFox 2+, Safari 3+, Chrome, Opera 9+. Easier syntax than straight-up Javascript code. Easy skinning with the JQuery Theme Picker. There is no shortage of documentation nor plugins (widgets). These prebuilt plugins are highly customizable. No need to reinvent the wheel: JQuery UI According to their site: jQuery UI provides abstractions for low-level interaction and animation, advanced effects and high-level, themeable widgets, built on top of the jQuery JavaScript Library, that you can use to build highly interactive web applications. For us it means an improved user experience without having to allocate resources to develop these technologies. How does JQuery work? JQuery allows you to select elements from your html code and apply attributes, effects, and classes to them. JQuery uses different selectors including (but not limited to): ✴ ✴ html tags like

or

  • . CSS ID or class selectors (.myElementID; #myClass). Where do I get JQuery? Download the library from: http://jquery.com/ Download the UI library (optional) at: http://jqueryui.com/ How to install JQuery Step 1: Download the JS file and call it the same way you include any script file: Step 2: ??? Step 3: Profit! I am including JQuery, now what? We start coding! Take the following code example: Everything inside it Why does JQuery use will load as soon as $(document).ready? the DOM is loaded and before the page contents are loaded. JQuery Structure In JQuery we can string commands (effects or attributes) together. Like so: $("#banner").addClass("highlighted").show("slow"); The previous code takes everything that has an id of “banner” and adds the class called “highlighted” them. It then displays these elements to the user using the “show” function. JQuery Structure $("#banner").addClass("highlighted").show("slow"); The selector.. jQuery(“#banner”) The attribute.. addClass(“highlighted”) The effect.. show(“slow”) 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. Full Code Example $("p").click(function () { $(this).slideUp(); }); $("p").hover(function () { $(this).addClass("hilite"); }, function () { $(this).removeClass("hilite"); }); 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. Full Code Example jQuery Some samples of JQuery http:// www.myphpdunia .com/2009/04/19/ top-10-jqueryexamples-withlive-demos/ Bloggers talking about JQuery and ColdFusion Ray Camden - coldfusionjedi.com John Farrar - sosensible.com Dan Wilson – nodans.com & cfuniform.riaforge.org J.J Merrick – JeremiahX.com John Mason - codfusion.com Books and Online Resources http://www.learningjquery.com http://docs.jquery.com - JQuery documentation http://api.jquery.com - JQuery API browser “Learning jQuery 1.3” by Karl Swedberg & Jonathan Chaffer “jQuery in Action” by Bear Bibeault, Yehuda Katz, and John Resig FIN

  • Related docs
    jQuery Introduction
    Views: 639  |  Downloads: 45
    An Introduction to jQuery
    Views: 186  |  Downloads: 31
    jQuery Selectors
    Views: 1477  |  Downloads: 72
    jQuery Slides
    Views: 137  |  Downloads: 18
    PDF jQuery Sample Chapter Final
    Views: 1  |  Downloads: 1
    Introduction
    Views: 19  |  Downloads: 0
    INTRODUCTION-TO-THE
    Views: 6  |  Downloads: 0
    INTRODUCTION
    Views: 5  |  Downloads: 0
    Introduction
    Views: 37  |  Downloads: 0
    Introduction
    Views: 1  |  Downloads: 0
    premium docs
    Other docs by jonathan Scott
    dv150s
    Views: 104  |  Downloads: 0
    Marshall Lefkowitz Briefs
    Views: 268  |  Downloads: 0
    de165
    Views: 101  |  Downloads: 0
    dv110s
    Views: 111  |  Downloads: 0
    dv140s
    Views: 91  |  Downloads: 1
    Italian Food Terms Glossary
    Views: 2865  |  Downloads: 57
    dv260
    Views: 81  |  Downloads: 0
    Vegetarian Diets: Build on the Basics
    Views: 229  |  Downloads: 4
    Hannah v Peel
    Views: 373  |  Downloads: 3
    I Will Never Be The Same Again
    Views: 240  |  Downloads: 4
    cr150
    Views: 107  |  Downloads: 0
    CorpsOKelley
    Views: 171  |  Downloads: 0
    Understandign English with French Ears
    Views: 518  |  Downloads: 28
    180 Books on Social Work, Sociology
    Views: 557  |  Downloads: 9
    Leonard v Pepsi
    Views: 508  |  Downloads: 4