SlideShare a Scribd company logo
jQuery 1.4 Cheat Sheet                                                                                                                                                                                          ImpulseStudios.ca
Core                                                Selectors                                         Effects                                           Events                                           Ajax
jQuery Function                                     Basic                                             Basics                                            Document Loading                                 Global Ajax Event Handlers
   $(selector, context)                   jQuery       *                                                 .hide(dur, cb)                       jQuery      .load(fn)                            jQuery       .ajaxComplete(cb)                     jQuery
   $(html, owner)                         jQuery       #id                                               .show(dur, cb)                       jQuery      .ready(fn)                           jQuery       .ajaxError(cb)                        jQuery
   $(callback)                            jQuery       element                                           .toggle(dur, cb)                     jQuery      .unload(fn)                          jQuery       .ajaxSend(cb)                         jQuery
No Conflict                                            .class                                            .toggle(showOrHide)                  jQuery    Event Handler Attachment                            .ajaxStart(cb)                        jQuery
                                                       selector, selectorN                            Fading                                              .bind(type, data, fn)                jQuery       .ajaxStop(cb)                         jQuery
   jQuery.noConflict(bool)                jQuery
                                                                                                         .fadeIn(dur, cb)                     jQuery      .bind(events)*                       jQuery       .ajaxSuccess(cb)                      jQuery
Attributes                                          Hierarchy
                                                       parent > child                                    .fadeOut(dur, cb)                    jQuery      .unbind(type, fn)                    jQuery    Helper Functions
General Attributes                                     ancestor descendant                               .fadeTo(dur, opacity, cb)            jQuery      .unbind(event)*                      jQuery       jQuery.param(obj, traditional)*        string
   .attr(attribute)                           obj      prev + next                                                                                        .live(type, data, fn)*               jQuery       .serialize()                           string
                                                                                                      Sliding
   .attr(attribute, val)                  jQuery                                                                                                          .die(type, fn)                       jQuery       .serialzeArray()                        array
                                                       prev ~ siblings                                   .slideUp(dur, cb)                    jQuery
   .attr(attribute, fn)                   jQuery                                                                                                          .one(type, data, fn)                 jQuery
                                                    Attribute                                            .slideDown(dur, cb)                  jQuery                                                     Low-Level Interface
   .removeAttr(attribute)                 jQuery                                                                                                          jQuery.proxy(fn, scope)*                 fn
                                                       [attribute|=val]                                  .slideToggle(dur, cb)                jQuery                                                        jQuery.ajax(settings)                   XHR
   .html()                                 string                                                                                                         jQuery.proxy(scope, name)*               fn
                                                       [attribute*=val]                                                                                                                                     jQuery.ajaxSetup(options)
   .html(string)                          jQuery                                                      Custom                                              .trigger(type, params)               jQuery
                                                       [attribute~=val]                                  .animate(prop, dur, easing, cb)      jQuery      .triggerHandler(type, params)           obj    Shorthand Methods
   .text()                                 string
                                                       [attribute$=val]                                  .animate(prop, options)              jQuery                                                        jQuery.get(url, data, cb, type)         XHR
   .text(string)                          jQuery                                                                                                        Browser Events
                                                       [attribute=val]                                   .delay(dur, queueName)*              jQuery                                                        jQuery.post(url, data, cb, type)        XHR
   .val()                           string, array                                                                                                         .error(fn)                           jQuery
                                                       [attribute!=val]                                  jQuery.fx.off                          bool                                                        jQuery.getJSON(url, data, cb)           XHR
   .val(value)                            jQuery                                                                                                          .resize(fn)                          jQuery
                                                       [attribute^=val]                                  .stop(clearQueue, jumpToEnd)         jQuery                                                        jQuery.getScript(url, cb)               XHR
                                                                                                                                                          .scroll(fn)                          jQuery
CSS                                                    [attribute]                                                                                                                                          .load(url, data, cb)                  jQuery
                                                       [attribute1=val1] [attribute2=val2]            Manipulation                                      Form Events
Style Properties                                                                                                                                          .blur(fn)                            jQuery    Traversing
   .css(property)                          string   Basic Filter                                      Copying
                                                                                                         .clone(withDataAndElements)          jQuery      .change(fn)                          jQuery    Tree Traversal
   .css(property, val|fn)*                jQuery       :animated
                                                                                                                                                          .focus(fn)                           jQuery       .children(selector)                   jQuery
                                                       :eq(index)                                     DOM Insertion, Around
Class Attribute                                                                                                                                           .select(fn)                          jQuery       .closest(selector, context)*          jQuery
                                                       :even                                             .wrap(element|fn)*                   jQuery
   .addClass(name|fn)*                    jQuery                                                                                                          .submit(fn)                          jQuery       .closest(selectors, context)*           array
                                                       :odd                                              .wrapAll(element)                    jQuery
   .removeClass(name|fn)*                 jQuery       :first                                                                                           Keyboard Events                                     .find(selector)                       jQuery
                                            bool                                                         .wrapInner(element|fn)*              jQuery
   .hasClass(name)                                     :last                                                                                              .focusin(fn)*                        jQuery       .next(selector)                       jQuery
                                          jQuery                                                         .unwrap()*                           jQuery
   .toggleClass(name|fn, switch)*                      :gt(index)                                                                                         .focusout(fn)*                       jQuery       .nextAll(selector)                    jQuery
Dimensions                                             :header                                        DOM Insertion, Inside                                                                                 .nextUntil(selector)*                 jQuery
                                                                                                                                                          .keydown(fn)                         jQuery
                                            int        :lt(index)                                        .append(content|fn)*                 jQuery                                                        .offsetParent()                       jQuery
   .height()                                                                                                                                              .keypress(fn)                        jQuery
                                         jQuery                                                          .appendTo(target)                    jQuery                                                        .parent(selector)                     jQuery
   .height(val)                                        :not(selector)                                                                                     .keyup(fn)                           jQuery
                                            int                                                          .prepend(content|fn)*                jQuery                                                        .parents(selector)                    jQuery
   .width()                                                                                                                                             Mouse Events
                                                    Content Filter                                       .prependTo(target)                   jQuery                                                        .parentsUntil(selector)*              jQuery
   .width(val)                           jQuery
                                                       :contains(text)                                                                                    .click(fn)                           jQuery
   .innerHeight()                           int                                                       DOM Insertion, Outside                                                                                .prev(selector)                       jQuery
                                                       :empty                                                                                             .dblclick(fn)                        jQuery
   .innerWidth()                            int                                                          .after(content|fn)*                  jQuery                                                        .prevAll(selector)                    jQuery
                                                       :has(selector)                                                                                     .hover(fn, fn)                       jQuery
   .outerHeight(margin)                     int                                                          .before(content|fn)*                 jQuery                                                        .prevUntil(selector)*                 jQuery
                                                       :parent                                                                                            .mousedown(fn)                       jQuery
   .outerWidth(margin)                      int                                                          .insertAfter()                       jQuery                                                        .siblings(selector)                   jQuery
                                                                                                                                                          .mouseenter(fn)                      jQuery
                                                    Visibility Filter                                    .insertBefore()                      jQuery                                                     Filtering
Offset                                                                                                                                                    .mouseleave(fn)                      jQuery
                                                       :hidden                                        DOM Removal                                         .mousemove(fn)                       jQuery       .eq(index)                            jQuery
   .offset()                        obj{top,left}
                                                       :visible                                          .detach(selector)*                   jQuery      .mouseout(fn)                        jQuery       .filter(selector)                     jQuery
   .offset(coordinates)*                      obj
   .position()                      obj{top,left}   Child Filter                                         .empty()                             jQuery      .mouseover(fn)                       jQuery       .filter(fn)                           jQuery
   .scrollLeft()                              int      :first-child                                      .remove(selector)                    jQuery      .mouseup(fn)                         jQuery       .first()                              jQuery
   .scrollLeft(val)                       jQuery       :last-child                                    DOM Replacement                                                                                       .last()                               jQuery
                                                                                                                                                        Event Object
   .scrollTop()                               int      :nth-child(index/even/odd/eq)                                                                                                                        .has(selector)*                       jQuery
                                                                                                         .replaceAll()                        jQuery      event.currentTarget               element
   .scrollLeft(val)                       jQuery       :only-child                                                                                                                                          .has(contained)*                      jQuery
                                                                                                         .replaceWith(content|fn)*            jQuery      event.data                       anything
                                                    Form                                                                                                                                                    .is(selector)                         jQuery
Data                                                                                                                                                      event.isDefaultPrevented()            bool
                                                       :button                                        Utilities                                           event.isImmediatePropagationStopped()bool
                                                                                                                                                                                                            .map(cb)                              jQuery
   jQuery.data(element, key, value)       jQuery                                                         jQuery.contains(container, contained)* bool                                                        .not(selector)                        jQuery
                                                       :checkbox                                                                                          event.isPropagationStopped()          bool
   jQuery.data(element, key)                  obj                                                        jQuery.each(obj, fn)                     obj                                                       .not(elements)                        jQuery
                                                       :checked                                                                                           event.pageX                           num
   .queue(queueName)                        array                                                        jQuery.extend(deep, target, obj, objN) obj                                                         .not(fn)                              jQuery
                                                       :disabled                                                                                          event.pageY                           num
   .queue(queueName, newQueue|cb)         jQuery                                                         jQuery.globalEval(code)
                                                       :enabled                                                                                           event.preventDefault                           Miscellaneous Traversing
   .clearQueue(queueName)*                jQuery                                                         jQuery.grep(array, fn, invert)         array
                                                       :file                                                                                              event.relatedTarget               element         .add(selector)                        jQuery
   .dequeue(queueName)                    jQuery                                                         jQuery.inArray(val, array)             num
                                                       :image                                                                                             event.result                            obj       .add(elements)                        jQuery
Miscellaneous                                          :input                                            jQuery.isArray(obj)                    bool      event.stopImmediatePropagation()                  .add(html)                            jQuery
                                                       :password                                         jQuery.isEmptyObject(obj)*             bool      event.target                      element         .add(selector, context)*              jQuery
Collection Manipulation                                :radio                                            jQuery.isFunction()                    bool      event.timeStamp                       num         .andSelf()                            jQuery
   .each(fn)                              jQuery       :reset                                            jQuery.isPlainObject(obj)*             bool      event.type                           string       .contents()                           jQuery
Collection Manipulation                                :selected                                         jQuery.isXMLDoc(node)                  bool      event.which                          string       .end()                                jQuery
   .get(index)                  element, array         :submit                                           jQuery.makeArray(obj)                  array
   .index(selector|element)*             num           :text                                             jQuery.map(array, cb)                  array   Legend
   .size()                               num                                                             jQuery.merge(array1, array2)           array     light text               optional parameter       cb                                   callback
                                                    Properties of the Global jQuery Object
   .toArray()*                           array                                                           jQuery.noop*                              fn     item|item                                 or      num                                  number
                                                       jQuery.support                           obj
                                                                                                         jQuery.trim()                         string     obj                                   object      val                                     value
                                                       jQuery.browser                         map
                                                                                                         jQuery.unique(array)                   array     bool                                boolean       dur                                 duration
                                                       jQuery.browser.version                string
                                                                                                                                                          fn                                  function      *                       new or updated in 1.4

More Related Content

Viewers also liked

Beginning jQuery
Beginning jQueryBeginning jQuery
Beginning jQuery
dhruvgairola
 
jQuery Best Practice
jQuery Best Practice jQuery Best Practice
jQuery Best Practice
chandrashekher786
 
Introducing jQuery
Introducing jQueryIntroducing jQuery
Introducing jQuery
Wildan Maulana
 
Intro to jQuery
Intro to jQueryIntro to jQuery
Intro to jQuery
Ralph Whitbeck
 
JavaScript the Smart Way - Getting Started with jQuery
JavaScript the Smart Way - Getting Started with jQueryJavaScript the Smart Way - Getting Started with jQuery
JavaScript the Smart Way - Getting Started with jQuery
katbailey
 
Jquery
JqueryJquery
Jquery
Zoya Shaikh
 
Intro to jquery
Intro to jqueryIntro to jquery
Intro to jquery
Dan Pickett
 
Efficient use of jQuery selector
Efficient use of jQuery selectorEfficient use of jQuery selector
Efficient use of jQuery selector
chandrashekher786
 
J query 17-visual-cheat-sheet
J query 17-visual-cheat-sheetJ query 17-visual-cheat-sheet
J query 17-visual-cheat-sheet
Renuka Prasad Yarasu
 
WordCamp London 2013
WordCamp London 2013WordCamp London 2013
WordCamp London 2013
Ivelina Dimova
 
webstudy jquery
webstudy jquerywebstudy jquery
webstudy jquery
Seungho Han
 
Learn JS concepts by implementing jQuery
Learn JS concepts by implementing jQueryLearn JS concepts by implementing jQuery
Learn JS concepts by implementing jQuery
Wingify Engineering
 
Introductory css and j query
Introductory css and j queryIntroductory css and j query
jQuery Beginner
jQuery BeginnerjQuery Beginner
jQuery Beginner
kumar gaurav
 
JAVASCRIPT and JQUERY For Beginner
JAVASCRIPT and JQUERY  For BeginnerJAVASCRIPT and JQUERY  For Beginner
JAVASCRIPT and JQUERY For Beginner
ROHIT SHARMA
 
jQuery Effects
jQuery EffectsjQuery Effects
jQuery Effects
Adelon Zeta
 
jQuery basics
jQuery basicsjQuery basics
jQuery basics
Kamal S
 
Svobodná firma - život v permanentní změně
Svobodná firma - život v permanentní změněSvobodná firma - život v permanentní změně
Svobodná firma - život v permanentní změně
Jan Sirotek
 
Basics of j query
Basics of j queryBasics of j query
Basics of j query
Rupesh Kumar Tiwari
 
Jquery Fundamentals
Jquery FundamentalsJquery Fundamentals
Jquery Fundamentals
Rebecca Murphey
 

Viewers also liked (20)

Beginning jQuery
Beginning jQueryBeginning jQuery
Beginning jQuery
 
jQuery Best Practice
jQuery Best Practice jQuery Best Practice
jQuery Best Practice
 
Introducing jQuery
Introducing jQueryIntroducing jQuery
Introducing jQuery
 
Intro to jQuery
Intro to jQueryIntro to jQuery
Intro to jQuery
 
JavaScript the Smart Way - Getting Started with jQuery
JavaScript the Smart Way - Getting Started with jQueryJavaScript the Smart Way - Getting Started with jQuery
JavaScript the Smart Way - Getting Started with jQuery
 
Jquery
JqueryJquery
Jquery
 
Intro to jquery
Intro to jqueryIntro to jquery
Intro to jquery
 
Efficient use of jQuery selector
Efficient use of jQuery selectorEfficient use of jQuery selector
Efficient use of jQuery selector
 
J query 17-visual-cheat-sheet
J query 17-visual-cheat-sheetJ query 17-visual-cheat-sheet
J query 17-visual-cheat-sheet
 
WordCamp London 2013
WordCamp London 2013WordCamp London 2013
WordCamp London 2013
 
webstudy jquery
webstudy jquerywebstudy jquery
webstudy jquery
 
Learn JS concepts by implementing jQuery
Learn JS concepts by implementing jQueryLearn JS concepts by implementing jQuery
Learn JS concepts by implementing jQuery
 
Introductory css and j query
Introductory css and j queryIntroductory css and j query
Introductory css and j query
 
jQuery Beginner
jQuery BeginnerjQuery Beginner
jQuery Beginner
 
JAVASCRIPT and JQUERY For Beginner
JAVASCRIPT and JQUERY  For BeginnerJAVASCRIPT and JQUERY  For Beginner
JAVASCRIPT and JQUERY For Beginner
 
jQuery Effects
jQuery EffectsjQuery Effects
jQuery Effects
 
jQuery basics
jQuery basicsjQuery basics
jQuery basics
 
Svobodná firma - život v permanentní změně
Svobodná firma - život v permanentní změněSvobodná firma - život v permanentní změně
Svobodná firma - život v permanentní změně
 
Basics of j query
Basics of j queryBasics of j query
Basics of j query
 
Jquery Fundamentals
Jquery FundamentalsJquery Fundamentals
Jquery Fundamentals
 

Jquery14

  • 1. jQuery 1.4 Cheat Sheet ImpulseStudios.ca Core Selectors Effects Events Ajax jQuery Function Basic Basics Document Loading Global Ajax Event Handlers $(selector, context) jQuery * .hide(dur, cb) jQuery .load(fn) jQuery .ajaxComplete(cb) jQuery $(html, owner) jQuery #id .show(dur, cb) jQuery .ready(fn) jQuery .ajaxError(cb) jQuery $(callback) jQuery element .toggle(dur, cb) jQuery .unload(fn) jQuery .ajaxSend(cb) jQuery No Conflict .class .toggle(showOrHide) jQuery Event Handler Attachment .ajaxStart(cb) jQuery selector, selectorN Fading .bind(type, data, fn) jQuery .ajaxStop(cb) jQuery jQuery.noConflict(bool) jQuery .fadeIn(dur, cb) jQuery .bind(events)* jQuery .ajaxSuccess(cb) jQuery Attributes Hierarchy parent > child .fadeOut(dur, cb) jQuery .unbind(type, fn) jQuery Helper Functions General Attributes ancestor descendant .fadeTo(dur, opacity, cb) jQuery .unbind(event)* jQuery jQuery.param(obj, traditional)* string .attr(attribute) obj prev + next .live(type, data, fn)* jQuery .serialize() string Sliding .attr(attribute, val) jQuery .die(type, fn) jQuery .serialzeArray() array prev ~ siblings .slideUp(dur, cb) jQuery .attr(attribute, fn) jQuery .one(type, data, fn) jQuery Attribute .slideDown(dur, cb) jQuery Low-Level Interface .removeAttr(attribute) jQuery jQuery.proxy(fn, scope)* fn [attribute|=val] .slideToggle(dur, cb) jQuery jQuery.ajax(settings) XHR .html() string jQuery.proxy(scope, name)* fn [attribute*=val] jQuery.ajaxSetup(options) .html(string) jQuery Custom .trigger(type, params) jQuery [attribute~=val] .animate(prop, dur, easing, cb) jQuery .triggerHandler(type, params) obj Shorthand Methods .text() string [attribute$=val] .animate(prop, options) jQuery jQuery.get(url, data, cb, type) XHR .text(string) jQuery Browser Events [attribute=val] .delay(dur, queueName)* jQuery jQuery.post(url, data, cb, type) XHR .val() string, array .error(fn) jQuery [attribute!=val] jQuery.fx.off bool jQuery.getJSON(url, data, cb) XHR .val(value) jQuery .resize(fn) jQuery [attribute^=val] .stop(clearQueue, jumpToEnd) jQuery jQuery.getScript(url, cb) XHR .scroll(fn) jQuery CSS [attribute] .load(url, data, cb) jQuery [attribute1=val1] [attribute2=val2] Manipulation Form Events Style Properties .blur(fn) jQuery Traversing .css(property) string Basic Filter Copying .clone(withDataAndElements) jQuery .change(fn) jQuery Tree Traversal .css(property, val|fn)* jQuery :animated .focus(fn) jQuery .children(selector) jQuery :eq(index) DOM Insertion, Around Class Attribute .select(fn) jQuery .closest(selector, context)* jQuery :even .wrap(element|fn)* jQuery .addClass(name|fn)* jQuery .submit(fn) jQuery .closest(selectors, context)* array :odd .wrapAll(element) jQuery .removeClass(name|fn)* jQuery :first Keyboard Events .find(selector) jQuery bool .wrapInner(element|fn)* jQuery .hasClass(name) :last .focusin(fn)* jQuery .next(selector) jQuery jQuery .unwrap()* jQuery .toggleClass(name|fn, switch)* :gt(index) .focusout(fn)* jQuery .nextAll(selector) jQuery Dimensions :header DOM Insertion, Inside .nextUntil(selector)* jQuery .keydown(fn) jQuery int :lt(index) .append(content|fn)* jQuery .offsetParent() jQuery .height() .keypress(fn) jQuery jQuery .appendTo(target) jQuery .parent(selector) jQuery .height(val) :not(selector) .keyup(fn) jQuery int .prepend(content|fn)* jQuery .parents(selector) jQuery .width() Mouse Events Content Filter .prependTo(target) jQuery .parentsUntil(selector)* jQuery .width(val) jQuery :contains(text) .click(fn) jQuery .innerHeight() int DOM Insertion, Outside .prev(selector) jQuery :empty .dblclick(fn) jQuery .innerWidth() int .after(content|fn)* jQuery .prevAll(selector) jQuery :has(selector) .hover(fn, fn) jQuery .outerHeight(margin) int .before(content|fn)* jQuery .prevUntil(selector)* jQuery :parent .mousedown(fn) jQuery .outerWidth(margin) int .insertAfter() jQuery .siblings(selector) jQuery .mouseenter(fn) jQuery Visibility Filter .insertBefore() jQuery Filtering Offset .mouseleave(fn) jQuery :hidden DOM Removal .mousemove(fn) jQuery .eq(index) jQuery .offset() obj{top,left} :visible .detach(selector)* jQuery .mouseout(fn) jQuery .filter(selector) jQuery .offset(coordinates)* obj .position() obj{top,left} Child Filter .empty() jQuery .mouseover(fn) jQuery .filter(fn) jQuery .scrollLeft() int :first-child .remove(selector) jQuery .mouseup(fn) jQuery .first() jQuery .scrollLeft(val) jQuery :last-child DOM Replacement .last() jQuery Event Object .scrollTop() int :nth-child(index/even/odd/eq) .has(selector)* jQuery .replaceAll() jQuery event.currentTarget element .scrollLeft(val) jQuery :only-child .has(contained)* jQuery .replaceWith(content|fn)* jQuery event.data anything Form .is(selector) jQuery Data event.isDefaultPrevented() bool :button Utilities event.isImmediatePropagationStopped()bool .map(cb) jQuery jQuery.data(element, key, value) jQuery jQuery.contains(container, contained)* bool .not(selector) jQuery :checkbox event.isPropagationStopped() bool jQuery.data(element, key) obj jQuery.each(obj, fn) obj .not(elements) jQuery :checked event.pageX num .queue(queueName) array jQuery.extend(deep, target, obj, objN) obj .not(fn) jQuery :disabled event.pageY num .queue(queueName, newQueue|cb) jQuery jQuery.globalEval(code) :enabled event.preventDefault Miscellaneous Traversing .clearQueue(queueName)* jQuery jQuery.grep(array, fn, invert) array :file event.relatedTarget element .add(selector) jQuery .dequeue(queueName) jQuery jQuery.inArray(val, array) num :image event.result obj .add(elements) jQuery Miscellaneous :input jQuery.isArray(obj) bool event.stopImmediatePropagation() .add(html) jQuery :password jQuery.isEmptyObject(obj)* bool event.target element .add(selector, context)* jQuery Collection Manipulation :radio jQuery.isFunction() bool event.timeStamp num .andSelf() jQuery .each(fn) jQuery :reset jQuery.isPlainObject(obj)* bool event.type string .contents() jQuery Collection Manipulation :selected jQuery.isXMLDoc(node) bool event.which string .end() jQuery .get(index) element, array :submit jQuery.makeArray(obj) array .index(selector|element)* num :text jQuery.map(array, cb) array Legend .size() num jQuery.merge(array1, array2) array light text optional parameter cb callback Properties of the Global jQuery Object .toArray()* array jQuery.noop* fn item|item or num number jQuery.support obj jQuery.trim() string obj object val value jQuery.browser map jQuery.unique(array) array bool boolean dur duration jQuery.browser.version string fn function * new or updated in 1.4