0% found this document useful (0 votes)
31 views

Jquery 1.4 Api Cheat Sheet: Selectors Core Traversing Events Ajax

This document provides a summary of jQuery selectors, core functions, traversing methods, events, AJAX capabilities and shorthand methods. It lists various selectors like #id, .class and element filters like :first, :last. It also outlines core jQuery objects and functions, methods for traversing the DOM like .children(), .closest() and tree traversal. Event handling methods like .bind() and .trigger() are presented along with AJAX functions such as .load(), .get() and .post().

Uploaded by

ashishjain7
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

Jquery 1.4 Api Cheat Sheet: Selectors Core Traversing Events Ajax

This document provides a summary of jQuery selectors, core functions, traversing methods, events, AJAX capabilities and shorthand methods. It lists various selectors like #id, .class and element filters like :first, :last. It also outlines core jQuery objects and functions, methods for traversing the DOM like .children(), .closest() and tree traversal. Event handling methods like .bind() and .trigger() are presented along with AJAX functions such as .load(), .get() and .post().

Uploaded by

ashishjain7
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

jQuery 1.

4 API Cheat Sheet


Selectors Core Traversing Events AJAX
Basics Hierarchy jQuery function Filtering Page Load Low-Level Interface
#id ancestor descendant $ .jQuery( selector [, context] ), .jQuery( element ), $ .eq( index ) $ .ready( fn() ) XHR jQuery.ajax( options )
element parent > child .jQuery( elementArray ), .jQuery( jQueryObject ), $ .first( ) 1.4+ Event Handling bool async = true fn beforeSend( XHR )
.class, .class.class prev + next .jQuery( ) 1.4∗ $ .last( ) 1.4+ bool cache = true fn complete(XHR, status)
$ .bind( type [, data ], fn(eventObj) ), .bind( array ) 1.4∗
* prev ~ siblings $ .jQuery( html [, ownerDocument] ), $ .has( selector ), .has( element ) 1.4+ str contentType obj context
.jQuery( html, props ) 1.4∗
$ .one( type [, data ], fn(eventObj) )
selector1, selector2 $ .filter( selector ), .filter( fn(index) ) obj, str data fn dataFilter( data, type )
$ .jQuery( fn ) $ .trigger( event [, data])
bool .is( selector ) bool global = true bool ifModified = false
Basic Filters Content Filters obj .triggerHandler( event [, data]) str jsonp fn jsonpCallback
:first :contains(text)
jQuery Object Accessors $ .map( fn(index, element) ) $ .unbind( [type] [, fn]) str password bool processData = true
:last :empty
$ .each( fn(index, element) ) $ .not( selector ), .not( elements ), $ .delegate( selector, eventType, [eventData], handler) num timeout str type = 'GET'
:not(selector) :has(selector) num .size( ), .length .not( fn( index ) ) 1.4+ str url = curr. page str username
str .selector $ .slice( start [, end] ) $ .undelegate( [selector, eventType, [handler]]) 1.4+ fn xhr str scriptCharset
:even :parent str dataType ∈ {xml, json, script, html}
:odd el .context Tree traversal
$ .eq( index ) Live Events fn error( XHR, status, errorThrown ) fn success( data, status, XHR )
:eq(index) Visibility Filters $ .children( [selector] ) $ .live( eventType [, data], fn() )
:hidden jQuery.error( str ) 1.4+ jQuery.ajaxSetup( options )
:gt(index) $ .closest( selector [, context] ) 1.4∗ $ .die( ) 1.4+, .die( [eventType] [, fn() ])
:lt(index) :visible [el],el .get( [index] ) arr .closest( selectors [, context] ) 1.4+
Shorthand Methods
:header num .index( ) 1.4∗, .index( selector ) 1.4∗, .index( element ) Interaction Helpers $ .load( url [, data] [, fn( responseText, status, XHR )] )
$ .find( selector ) $ .hover( fnIn(eventObj), fnOut(eventObj))
:animated $ jQuery.pushStack( elements, [name, arguments] ) XHR jQuery.get( url [, data] [, fn( data, status, XHR )] [, type] )
$ .next( [selector] ) $ .toggle( fn(eventObj), fn2(eventObj) [, ...])
arr .toArray( ) 1.4+ XHR jQuery.getJSON( url [, data] [, fn( data, status )] )
Child Filters Attribute Filters $ .nextAll( [selector] )
Interoperability Event Helpers XHR jQuery.getScript( url [, fn( data, status )] )
:nth-child(expr) [attribute] $ .nextUntil( [selector] ) 1.4+
$ jQuery.noConflict( [extreme] ) $ .blur( [fn] ), .mousedown( [fn] ), XHR jQuery.post( url [, data] [, fn( data, status )] [, type] )
:first-child [attribute=value] $ .offsetParent( )
$ .parent( [selector] ) .change( [fn] ), .mouseenter( [fn] ), Global Ajax Event Handlers
:last-child [attribute!=value]
:only-child [attribute^=value] Attributes $ .parents( [selector] ) .click( [fn] ), .mouseleave( [fn] ), $ .ajaxComplete( fn( event, XHR, options ) )
[attribute$=value] Attributes $ .parentsUntil( [selector] ) 1.4+ .dblclick( [fn] ), .mousemove( [fn] ), $ .ajaxError( fn( event, XHR, options, thrownError ) )
[attribute*=value] str .attr( name ) $ .prev( [selector] ) .error( [fn] ), .mouseout( [fn] ), $ .ajaxSend( fn( event, XHR, options ) )
[attribute|=value] $ .attr( name, val ), .attr( map ), .attr( name, fn(index, attr) ) $ .prevAll( [selector] ) .focus( [fn] ), .mouseover( [fn] ), $ .ajaxStart( fn( ) )
[attribute~=value] $ .removeAttr( name ) $ .prevUntil( [selector] ) 1.4+ .focusin( [fn] ), 1.4+ .mouseup( [fn] ), $ .ajaxStop( fn( ) )
[attribute][attribute2] $ .siblings( [selector] ) .focusout( [fn] ), 1.4+ .resize( [fn] ), $ .ajaxSuccess( fn(event, XHR, options) )
Class .keydown( [fn] ), .scroll( [fn] ),
Forms Form Filters $ .addClass( class ), .addClass( fn(index, class) ) 1.4∗ Miscellaneous Miscellaneous
.keypress( [fn] ), .select( [fn] ), str .serialize( )
:input :enabled bool .hasClass( class ) $ .add( selector [, context] ), .add( elements ),
.keyup( [fn] ), .submit( [fn] ), [obj] .serializeArray( )
:text :disabled $ .removeClass( [class] ), .add( html ) 1.4∗
$ .andSelf( ) .load( fn ), .unload( fn ) str jQuery.param( obj, [traditional] ) 1.4∗
:password :checked .removeClass( fn(index, class) ) 1.4∗
:radio :selected $ .toggleClass( class [, switch] ), $ .contents( ) Event object
:checkbox .toggleClass( fn(index, class) [, switch] ) 1.4∗ $ .end( ) event
el
={
currentTarget,
Utilities
:submit HTML, text Browser and Feature Detection
* data,
:image
:reset
str .html( ) Manipulation bool isDefaultPrevented(), obj jQuery.support
$ .html( val ), .html( fn(index, html) ) 1.4∗ Inserting Inside bool isImmediatePropagationStopped(), obj jQuery.browser deprecated
:button str jQuery.browser.version deprecated
str .text( ) $ .append( content ), bool isPropagationStopped(),
:file num pageX,
$ .text( val ), .text( fn(index, html) ) 1.4∗ .append( fn( index, html ) ) 1.4∗ bool jQuery.boxModel deprecated
$ .appendTo( target ) num pageY,
Value preventDefault(), Basic operations
$ .prepend( content ),
Legend str,arr .val( )
.prepend( fn( index, html ) ) 1.4∗
el relatedTarget, obj jQuery.each( obj, fn( index, valueOfElement ) )
$ .val( val ), .val( fn() ) 1.4∗ obj result, obj jQuery.extend( [deep,] target, obj1 [, objN] )
$ .prependTo( target ) stopImmediatePropagation(),
Conventional signs arr jQuery.grep( array, fn( element, index ) [, invert] )
Inserting Outside stopPropagation(),
[obj] — array of objects CSS $ .after( content ), .after( fn() ) 1.4∗ el target,
arr jQuery.makeArray( obj )
1.4+ — new in 1.4 CSS arr jQuery.map( array, fn( element, index ) )
num timeStamp,
str .css( name ) $ .before( content ), .before( fn() ) 1.4∗ str type, num jQuery.inArray( val, array )
1.4∗ — changed in 1.4 $ .insertAfter( target )
$ .css( name, val ), .css( map ), str which arr jQuery.merge( first, second )
Data types .css( name, fn(index, val) ) 1.4∗ $ .insertBefore( target ) } fn jQuery.noop 1.4+
Inserting Around fn jQuery.proxy( fn, scope ), jQuery.proxy( scope, name ) 1.4+
* — anything Positioning
$ — jQuery object obj .offset( ) $ .unwrap( ) 1.4+ Effects arr jQuery.unique( array )
$ .offset( coord ), .offset( fn( index, coord ) ) 1.4+ $ .wrap( wrappingElement ), .wrap( fn ) 1.4∗ Basics str jQuery.trim( str )
arr — array $ .wrapAll(wrappingElement ), $ .show( [ duration [, fn] ] ) obj jQuery.parseJSON( str ) 1.4+
bool — boolean
$ .offsetParent( )
.wrapAll( fn ) 1.4∗ $ .hide( [ duration [, fn] ] ) Data functions
obj .position( )
el — DOM element $ .wrapInner( wrappingElement ), $ .toggle( [showOrHide] ) $ .clearQueue( [name] ) 1.4+
int .scrollTop( )
fn — function .wrapInner( fn ) 1.4∗ $ .toggle( duration [, fn] ) $ .dequeue( [name] ), jQuery.dequeue( [name] )
$ .scrollTop( val )
int — integer int .scrollLeft( ) Replacing Sliding obj jQuery.data( element, key ), jQuery.data( ) 1.4+
obj — object $ .scrollLeft( val ) $ .replaceWith( content ), $ .slideDown( duration [, fn] ) obj .data( ), .data( key )
str — string .replaceWith( fn ) 1.4∗ $ .slideUp( duration [, fn] ) $ .data( key, val ), .data( obj ) 1.4∗
Height and Width $ .replaceAll( selector )
XHR — XMLHttpRequest $ .slideToggle( [duration] [, fn] ) $ .removeData( [name] )
int .height( )
Removing Fading [fn] .queue( [name] ) jQuery.queue( [name] )
$ .height( val ), .height( fn(index, height ) ) 1.4∗
$ .detach( [selector] ) 1.4+ $ .fadeIn( duration [, fn] ) $ .queue( [name,] fn( next ) ), jQuery.queue( [name,] fn( ) )
int .width( )
http://futurecolors.ru/jquery/ $ .width( val ), .width(( fn(index, height ) ) 1.4∗
$ .empty( ) $ .fadeOut( duration [, fn] ) $ .queue( [name,] queue ), jQuery.queue( [name,] queue )
ver. 09-03-2010 int .innerHeight( )
$ .remove( [selector] ) $ .fadeTo( duration, opacity [, fn] ) Test operations
int .innerWidth( ) Copying Custom bool jQuery.isArray( obj )
int .outerHeight( [margin] ) $ .clone( [withDataAndEvents] ) $ .animate( params [, duration] [, easing] [, fn] ) bool jQuery.isEmptyObject( obj ) 1.4+
int .outerWidth( [margin] ) $ .animate( params, options ) bool jQuery.isFunction( obj )
$ .stop( [clearQueue] [, jumpToEnd] ) bool jQuery.isPlainObject( obj ) 1.4+
$ .delay( duration [, queueName] ) 1.4+
Settings
bool jQuery.fx.off

You might also like