jQuery secrets

Bastian Feder
Bastian FederSenior Application Developer
jQuery secrets
Bastian Feder       IPC Spring 2011 Berlin
lapistano@php.net           31th May 2011
Me, myself & I

 JavaScript since 2002
 PHP since 2001
 Opensource addict
   PHP manual translations
   FluentDOM
Utilities
Saving the state

 jQuery.data(element, key[, value])
   Store any kind of information
   on a DOM element
   Circular references avoided
   Low level function use
   $().data() instead.
Saving possible?

 jQuery.acceptData( element )
   Low level function invoked by
   $(elem).data()
   Extend jQuery.noData to set
   additional constraints
   Does not raise an
   error/exception
Removing the state

 jQuery.removeData(element[, key])
   Low level function use
   $().removeData([key])
   instead.
   Removes all data if no key is
   passed.
State example

 var logo = $('#jq-siteLogo');

 $(document).data('logo', logo);

 $(logo).detach();

 $('fieldset[class="toc"]')
   .before($(document).data('logo'));

 $(document).removeData('logo');
Extending for the good

  jQuery.extend([deep], target[, object1][, objectN])

var defaults = {
    validate: false,
    limit: {max: 5, min: 1},
    name: "foo"
};
var options = {
    validate: true,
    limit: {max:10}
};
var settings = $.extend(true, {}, defaults, options);
Extending for the good                        (II)

(function($, jQuery, undefined) {

 jQuery.fn.myPlugin = function( options ) {
   var options = $.extend(
      {},
      jQuery.fn.myPlugin.defaults,
      Options
   );
   // put plugin code here //
 }

 jQuery.fn.myPlugin.defaults = {
    'color': '#fff',
    'myPublicMethod': function(){}
 };

})(jQuery, jQuery);
jQuery.props[]

 Register of translations
 Used by .attr()
  jQuery.props = {
     "for"         : "htmlFor",
     "class"       : "className",
     "frameborder" : "frameBorder",
     …
  };

  jQuery.props['uiwDiv'] =
      'ui-jeopardysection-gameboard-header';
AJAX
Global AJAX settings

  jQuery.ajaxSetup( options )

$.ajaxSetup({
   url: "/xmlhttp/",
   username: "paul",
   passwort: "secret"

});
$.ajax({ data: myData });
Global AJAX settings                (II)


 Methods to set properties defined by $.ajax()
 Examples:
   $.ajaxSuccess()
   $.ajaxError()
   $.ajaxStart()
   …
Shortcuts

  .load(url,[data,]
     [complete(responseText, textStatus, XHR)])

$('#ticker').load('http://liip.ch#entry1790');
Promises & Deferreds

  Proposed by CommonJS
  Since jQuery 1.5

var a1 = $.ajax('page1');
var a2 = $.ajax('page2');

$.when(a1, a2).then(
  function() { alert('Called when request successful!'),
  function() { alert('Called, when request failed.')
}
Events
Event binding

  .bind(type[, data], handler(event))
    'type' might also be an object

$('.clickable').bind({
  'click': function(event) { //callback },
  'mousedown': function(event) { //callback }
});
Namespaces

$('.clickable').bind('click.namespace', function(e){});

$('.clickable').bind({
  'click.namespace': function(event) { //callback },
  'mousedown.namespace': function(event) { //callback }
});

$('.clickable').unbind('.namespace');
„global“ Events

  ajaxStart
  ajaxStop

$('#indicator')
  .bind({
    'ajaxStart.ajaxindicator': function() {
       // show tumble image
    },
    'ajaxStop.ajaxindicator': function() {
       // hide tumble image
    }
});
Selfdefined speeding

$.extend(jQuery.fx.speeds, {
   slow: 600,
   fast: 200,
   // Default speed
   _default: 400
},
{
   slowmotion: 100,
});

$('#clickme').click(function() {
  $('#book').fadeIn('slowmotion');
});
Extending
 jQuery
jQuery plugins

  jQuery.error( msg )

jQuery.error = function( msg, code ) {
  var error = [];
  error[msg] = message;
  error['code'] = $errorcode;
  if (typeof console != undefined) {
    console.error(error)
  }
  throw msg;
}
jQuery UI

$.extend('ui.autosuggest.prototype, {
  _search: function( value ) {
    // always save the actual value,
    // not the one passed as an argument
    this.term = this.element
      .addClass( "ui-autocomplete-loading"
      .val();

      this.source( { term: value }, this.response );
});
Sizzle.selectors

  jQuery.expr.filters
  jQuery.expr[':']

 $.extend(
   $.expr.filters,
   {
     "myPseudoSelector": function( node, index, match ) {
       // return true, if s.th. Was selected
       // return false, if not.
     }
   });
Book recommendation

             Jakob Westhoff
             http://westhoffswelt.de
             ISBN:
             978-3-86802-052-6
             E-Book-ISBN:
             978-3-86802-237-7
Feedback, pls

 Joind.in
 http://joind.in/talk/view/3511
 Slides
 http://slideshare.net/lapistano
 Email
 lapistano@php.net
 IRC on freenode
 lapistano
License

 This set of slides and the source code included
  in the download package is licensed under the

 Creative Commons Attribution-
 Noncommercial-Share Alike 2.0 Generic
 License


 http://creativecommons.org/licenses/by-nc-sa/2.0/deed.en
1 of 27

Recommended

Php unit the-mostunknownparts by
Php unit the-mostunknownpartsPhp unit the-mostunknownparts
Php unit the-mostunknownpartsBastian Feder
2.6K views26 slides
The Beauty and the Beast by
The Beauty and the BeastThe Beauty and the Beast
The Beauty and the BeastBastian Feder
3.2K views32 slides
The Beauty And The Beast Php N W09 by
The Beauty And The Beast Php N W09The Beauty And The Beast Php N W09
The Beauty And The Beast Php N W09Bastian Feder
4.5K views29 slides
Php unit the-mostunknownparts by
Php unit the-mostunknownpartsPhp unit the-mostunknownparts
Php unit the-mostunknownpartsBastian Feder
1.6K views33 slides
international PHP2011_Bastian Feder_jQuery's Secrets by
international PHP2011_Bastian Feder_jQuery's Secretsinternational PHP2011_Bastian Feder_jQuery's Secrets
international PHP2011_Bastian Feder_jQuery's Secretssmueller_sandsmedia
420 views28 slides
Design Patterns in PHP5 by
Design Patterns in PHP5 Design Patterns in PHP5
Design Patterns in PHP5 Wildan Maulana
1.7K views41 slides

More Related Content

What's hot

Quebec pdo by
Quebec pdoQuebec pdo
Quebec pdoValentine Dianov
741 views41 slides
Php 101: PDO by
Php 101: PDOPhp 101: PDO
Php 101: PDOJeremy Kendall
3.7K views75 slides
Unit and Functional Testing with Symfony2 by
Unit and Functional Testing with Symfony2Unit and Functional Testing with Symfony2
Unit and Functional Testing with Symfony2Fabien Potencier
20.4K views35 slides
Dependency injection in PHP 5.3/5.4 by
Dependency injection in PHP 5.3/5.4Dependency injection in PHP 5.3/5.4
Dependency injection in PHP 5.3/5.4Fabien Potencier
37.4K views114 slides
Dependency Injection with PHP 5.3 by
Dependency Injection with PHP 5.3Dependency Injection with PHP 5.3
Dependency Injection with PHP 5.3Fabien Potencier
75K views104 slides
Dependency Injection with PHP and PHP 5.3 by
Dependency Injection with PHP and PHP 5.3Dependency Injection with PHP and PHP 5.3
Dependency Injection with PHP and PHP 5.3Fabien Potencier
15.4K views105 slides

What's hot(20)

Unit and Functional Testing with Symfony2 by Fabien Potencier
Unit and Functional Testing with Symfony2Unit and Functional Testing with Symfony2
Unit and Functional Testing with Symfony2
Fabien Potencier20.4K views
Dependency injection in PHP 5.3/5.4 by Fabien Potencier
Dependency injection in PHP 5.3/5.4Dependency injection in PHP 5.3/5.4
Dependency injection in PHP 5.3/5.4
Fabien Potencier37.4K views
Dependency Injection with PHP and PHP 5.3 by Fabien Potencier
Dependency Injection with PHP and PHP 5.3Dependency Injection with PHP and PHP 5.3
Dependency Injection with PHP and PHP 5.3
Fabien Potencier15.4K views
Drupal 8 Sample Module by drubb
Drupal 8 Sample ModuleDrupal 8 Sample Module
Drupal 8 Sample Module
drubb940 views
Dependency injection-zendcon-2010 by Fabien Potencier
Dependency injection-zendcon-2010Dependency injection-zendcon-2010
Dependency injection-zendcon-2010
Fabien Potencier9.3K views
The Zen of Lithium by Nate Abele
The Zen of LithiumThe Zen of Lithium
The Zen of Lithium
Nate Abele2.6K views
Lithium: The Framework for People Who Hate Frameworks by Nate Abele
Lithium: The Framework for People Who Hate FrameworksLithium: The Framework for People Who Hate Frameworks
Lithium: The Framework for People Who Hate Frameworks
Nate Abele12.2K views
Drupal Field API. Practical usage by Pavel Makhrinsky
Drupal Field API. Practical usageDrupal Field API. Practical usage
Drupal Field API. Practical usage
Pavel Makhrinsky4.6K views
Dependency injection - phpday 2010 by Fabien Potencier
Dependency injection - phpday 2010Dependency injection - phpday 2010
Dependency injection - phpday 2010
Fabien Potencier4.3K views
Decouple Your Code For Reusability (International PHP Conference / IPC 2008) by Fabien Potencier
Decouple Your Code For Reusability (International PHP Conference / IPC 2008)Decouple Your Code For Reusability (International PHP Conference / IPC 2008)
Decouple Your Code For Reusability (International PHP Conference / IPC 2008)
Fabien Potencier4.2K views
Drupal 8: Forms by drubb
Drupal 8: FormsDrupal 8: Forms
Drupal 8: Forms
drubb1.8K views
Building Lithium Apps by Nate Abele
Building Lithium AppsBuilding Lithium Apps
Building Lithium Apps
Nate Abele5.7K views
The State of Lithium by Nate Abele
The State of LithiumThe State of Lithium
The State of Lithium
Nate Abele2.3K views
Drupal 8: Routing & More by drubb
Drupal 8: Routing & MoreDrupal 8: Routing & More
Drupal 8: Routing & More
drubb1K views
Doctrine with Symfony - SymfonyCon 2019 by julien pauli
Doctrine with Symfony - SymfonyCon 2019Doctrine with Symfony - SymfonyCon 2019
Doctrine with Symfony - SymfonyCon 2019
julien pauli334 views

Similar to jQuery secrets

jQuery secrets by
jQuery secretsjQuery secrets
jQuery secretsBastian Feder
1.3K views26 slides
J query training by
J query trainingJ query training
J query trainingFIS - Fidelity Information Services
429 views33 slides
jQuery's Secrets by
jQuery's SecretsjQuery's Secrets
jQuery's SecretsBastian Feder
4.2K views21 slides
jQuery: Events, Animation, Ajax by
jQuery: Events, Animation, AjaxjQuery: Events, Animation, Ajax
jQuery: Events, Animation, AjaxConstantin Titarenko
1.4K views21 slides
Virtual Madness @ Etsy by
Virtual Madness @ EtsyVirtual Madness @ Etsy
Virtual Madness @ EtsyNishan Subedi
524 views28 slides
Javascript Frameworks for Joomla by
Javascript Frameworks for JoomlaJavascript Frameworks for Joomla
Javascript Frameworks for JoomlaLuke Summerfield
1.3K views15 slides

Similar to jQuery secrets(20)

Building Large jQuery Applications by Rebecca Murphey
Building Large jQuery ApplicationsBuilding Large jQuery Applications
Building Large jQuery Applications
Rebecca Murphey7.8K views
jQuery: Tips, tricks and hints for better development and Performance by Jonas De Smet
jQuery: Tips, tricks and hints for better development and PerformancejQuery: Tips, tricks and hints for better development and Performance
jQuery: Tips, tricks and hints for better development and Performance
Jonas De Smet3.5K views
Writing Maintainable JavaScript by Andrew Dupont
Writing Maintainable JavaScriptWriting Maintainable JavaScript
Writing Maintainable JavaScript
Andrew Dupont3.1K views
Symfony2 Building on Alpha / Beta technology by Daniel Knell
Symfony2 Building on Alpha / Beta technologySymfony2 Building on Alpha / Beta technology
Symfony2 Building on Alpha / Beta technology
Daniel Knell750 views
Advanced jQuery by sergioafp
Advanced jQueryAdvanced jQuery
Advanced jQuery
sergioafp814 views
jQuery: out with the old, in with the new by Remy Sharp
jQuery: out with the old, in with the newjQuery: out with the old, in with the new
jQuery: out with the old, in with the new
Remy Sharp1.3K views
Taming that client side mess with Backbone.js by Jarod Ferguson
Taming that client side mess with Backbone.jsTaming that client side mess with Backbone.js
Taming that client side mess with Backbone.js
Jarod Ferguson2.7K views
DOM Scripting Toolkit - jQuery by Remy Sharp
DOM Scripting Toolkit - jQueryDOM Scripting Toolkit - jQuery
DOM Scripting Toolkit - jQuery
Remy Sharp3.4K views

More from Bastian Feder

JQuery plugin development fundamentals by
JQuery plugin development fundamentalsJQuery plugin development fundamentals
JQuery plugin development fundamentalsBastian Feder
1.3K views17 slides
Why documentation osidays by
Why documentation osidaysWhy documentation osidays
Why documentation osidaysBastian Feder
617 views16 slides
Solid principles by
Solid principlesSolid principles
Solid principlesBastian Feder
1.6K views39 slides
PhpUnit - The most unknown Parts by
PhpUnit - The most unknown PartsPhpUnit - The most unknown Parts
PhpUnit - The most unknown PartsBastian Feder
4.3K views27 slides
Introducing TDD to your project by
Introducing TDD to your projectIntroducing TDD to your project
Introducing TDD to your projectBastian Feder
1.4K views26 slides
Advanced Eclipse Workshop (held at IPC2010 -spring edition-) by
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)Bastian Feder
1.5K views46 slides

More from Bastian Feder(14)

JQuery plugin development fundamentals by Bastian Feder
JQuery plugin development fundamentalsJQuery plugin development fundamentals
JQuery plugin development fundamentals
Bastian Feder1.3K views
Why documentation osidays by Bastian Feder
Why documentation osidaysWhy documentation osidays
Why documentation osidays
Bastian Feder617 views
PhpUnit - The most unknown Parts by Bastian Feder
PhpUnit - The most unknown PartsPhpUnit - The most unknown Parts
PhpUnit - The most unknown Parts
Bastian Feder4.3K views
Introducing TDD to your project by Bastian Feder
Introducing TDD to your projectIntroducing TDD to your project
Introducing TDD to your project
Bastian Feder1.4K views
Advanced Eclipse Workshop (held at IPC2010 -spring edition-) by Bastian Feder
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Advanced Eclipse Workshop (held at IPC2010 -spring edition-)
Bastian Feder1.5K views
The beautyandthebeast phpbat2010 by Bastian Feder
The beautyandthebeast phpbat2010The beautyandthebeast phpbat2010
The beautyandthebeast phpbat2010
Bastian Feder1.1K views
Debugging PHP with xDebug inside of Eclipse PDT 2.1 by Bastian Feder
Debugging PHP with xDebug inside of Eclipse PDT 2.1Debugging PHP with xDebug inside of Eclipse PDT 2.1
Debugging PHP with xDebug inside of Eclipse PDT 2.1
Bastian Feder6K views
Eclipse HandsOn Workshop by Bastian Feder
Eclipse HandsOn WorkshopEclipse HandsOn Workshop
Eclipse HandsOn Workshop
Bastian Feder1.6K views
Eclipse Pdt2.0 26.05.2009 by Bastian Feder
Eclipse Pdt2.0 26.05.2009Eclipse Pdt2.0 26.05.2009
Eclipse Pdt2.0 26.05.2009
Bastian Feder832 views
Php Development With Eclipde PDT by Bastian Feder
Php Development With Eclipde PDTPhp Development With Eclipde PDT
Php Development With Eclipde PDT
Bastian Feder2K views
Php Documentor The Beauty And The Beast by Bastian Feder
Php Documentor The Beauty And The BeastPhp Documentor The Beauty And The Beast
Php Documentor The Beauty And The Beast
Bastian Feder4.7K views
Bubbles & Trees with jQuery by Bastian Feder
Bubbles & Trees with jQueryBubbles & Trees with jQuery
Bubbles & Trees with jQuery
Bastian Feder1.4K views
Ajax hands on - Refactoring Google Suggest by Bastian Feder
Ajax hands on - Refactoring Google SuggestAjax hands on - Refactoring Google Suggest
Ajax hands on - Refactoring Google Suggest
Bastian Feder1.2K views

Recently uploaded

REPRESENTATION - GAUNTLET.pptx by
REPRESENTATION - GAUNTLET.pptxREPRESENTATION - GAUNTLET.pptx
REPRESENTATION - GAUNTLET.pptxiammrhaywood
107 views26 slides
11.28.23 Social Capital and Social Exclusion.pptx by
11.28.23 Social Capital and Social Exclusion.pptx11.28.23 Social Capital and Social Exclusion.pptx
11.28.23 Social Capital and Social Exclusion.pptxmary850239
304 views25 slides
ACTIVITY BOOK key water sports.pptx by
ACTIVITY BOOK key water sports.pptxACTIVITY BOOK key water sports.pptx
ACTIVITY BOOK key water sports.pptxMar Caston Palacio
745 views4 slides
Drama KS5 Breakdown by
Drama KS5 BreakdownDrama KS5 Breakdown
Drama KS5 BreakdownWestHatch
87 views2 slides
Pharmaceutical Inorganic chemistry UNIT-V Radiopharmaceutical.pptx by
Pharmaceutical Inorganic chemistry UNIT-V Radiopharmaceutical.pptxPharmaceutical Inorganic chemistry UNIT-V Radiopharmaceutical.pptx
Pharmaceutical Inorganic chemistry UNIT-V Radiopharmaceutical.pptxMs. Pooja Bhandare
93 views51 slides
UNIDAD 3 6º C.MEDIO.pptx by
UNIDAD 3 6º C.MEDIO.pptxUNIDAD 3 6º C.MEDIO.pptx
UNIDAD 3 6º C.MEDIO.pptxMarcosRodriguezUcedo
124 views32 slides

Recently uploaded(20)

REPRESENTATION - GAUNTLET.pptx by iammrhaywood
REPRESENTATION - GAUNTLET.pptxREPRESENTATION - GAUNTLET.pptx
REPRESENTATION - GAUNTLET.pptx
iammrhaywood107 views
11.28.23 Social Capital and Social Exclusion.pptx by mary850239
11.28.23 Social Capital and Social Exclusion.pptx11.28.23 Social Capital and Social Exclusion.pptx
11.28.23 Social Capital and Social Exclusion.pptx
mary850239304 views
Drama KS5 Breakdown by WestHatch
Drama KS5 BreakdownDrama KS5 Breakdown
Drama KS5 Breakdown
WestHatch87 views
Pharmaceutical Inorganic chemistry UNIT-V Radiopharmaceutical.pptx by Ms. Pooja Bhandare
Pharmaceutical Inorganic chemistry UNIT-V Radiopharmaceutical.pptxPharmaceutical Inorganic chemistry UNIT-V Radiopharmaceutical.pptx
Pharmaceutical Inorganic chemistry UNIT-V Radiopharmaceutical.pptx
Ch. 7 Political Participation and Elections.pptx by Rommel Regala
Ch. 7 Political Participation and Elections.pptxCh. 7 Political Participation and Elections.pptx
Ch. 7 Political Participation and Elections.pptx
Rommel Regala105 views
Ch. 8 Political Party and Party System.pptx by Rommel Regala
Ch. 8 Political Party and Party System.pptxCh. 8 Political Party and Party System.pptx
Ch. 8 Political Party and Party System.pptx
Rommel Regala53 views
Sociology KS5 by WestHatch
Sociology KS5Sociology KS5
Sociology KS5
WestHatch76 views
Classification of crude drugs.pptx by GayatriPatra14
Classification of crude drugs.pptxClassification of crude drugs.pptx
Classification of crude drugs.pptx
GayatriPatra1492 views
ISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks Effectively by PECB
ISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks EffectivelyISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks Effectively
ISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks Effectively
PECB 598 views
AI Tools for Business and Startups by Svetlin Nakov
AI Tools for Business and StartupsAI Tools for Business and Startups
AI Tools for Business and Startups
Svetlin Nakov111 views
Use of Probiotics in Aquaculture.pptx by AKSHAY MANDAL
Use of Probiotics in Aquaculture.pptxUse of Probiotics in Aquaculture.pptx
Use of Probiotics in Aquaculture.pptx
AKSHAY MANDAL104 views

jQuery secrets

  • 1. jQuery secrets Bastian Feder IPC Spring 2011 Berlin lapistano@php.net 31th May 2011
  • 2. Me, myself & I JavaScript since 2002 PHP since 2001 Opensource addict PHP manual translations FluentDOM
  • 4. Saving the state jQuery.data(element, key[, value]) Store any kind of information on a DOM element Circular references avoided Low level function use $().data() instead.
  • 5. Saving possible? jQuery.acceptData( element ) Low level function invoked by $(elem).data() Extend jQuery.noData to set additional constraints Does not raise an error/exception
  • 6. Removing the state jQuery.removeData(element[, key]) Low level function use $().removeData([key]) instead. Removes all data if no key is passed.
  • 7. State example var logo = $('#jq-siteLogo'); $(document).data('logo', logo); $(logo).detach(); $('fieldset[class="toc"]') .before($(document).data('logo')); $(document).removeData('logo');
  • 8. Extending for the good jQuery.extend([deep], target[, object1][, objectN]) var defaults = { validate: false, limit: {max: 5, min: 1}, name: "foo" }; var options = { validate: true, limit: {max:10} }; var settings = $.extend(true, {}, defaults, options);
  • 9. Extending for the good (II) (function($, jQuery, undefined) { jQuery.fn.myPlugin = function( options ) { var options = $.extend( {}, jQuery.fn.myPlugin.defaults, Options ); // put plugin code here // } jQuery.fn.myPlugin.defaults = { 'color': '#fff', 'myPublicMethod': function(){} }; })(jQuery, jQuery);
  • 10. jQuery.props[] Register of translations Used by .attr() jQuery.props = { "for" : "htmlFor", "class" : "className", "frameborder" : "frameBorder", … }; jQuery.props['uiwDiv'] = 'ui-jeopardysection-gameboard-header';
  • 11. AJAX
  • 12. Global AJAX settings jQuery.ajaxSetup( options ) $.ajaxSetup({ url: "/xmlhttp/", username: "paul", passwort: "secret" }); $.ajax({ data: myData });
  • 13. Global AJAX settings (II) Methods to set properties defined by $.ajax() Examples: $.ajaxSuccess() $.ajaxError() $.ajaxStart() …
  • 14. Shortcuts .load(url,[data,] [complete(responseText, textStatus, XHR)]) $('#ticker').load('http://liip.ch#entry1790');
  • 15. Promises & Deferreds Proposed by CommonJS Since jQuery 1.5 var a1 = $.ajax('page1'); var a2 = $.ajax('page2'); $.when(a1, a2).then( function() { alert('Called when request successful!'), function() { alert('Called, when request failed.') }
  • 17. Event binding .bind(type[, data], handler(event)) 'type' might also be an object $('.clickable').bind({ 'click': function(event) { //callback }, 'mousedown': function(event) { //callback } });
  • 18. Namespaces $('.clickable').bind('click.namespace', function(e){}); $('.clickable').bind({ 'click.namespace': function(event) { //callback }, 'mousedown.namespace': function(event) { //callback } }); $('.clickable').unbind('.namespace');
  • 19. „global“ Events ajaxStart ajaxStop $('#indicator') .bind({ 'ajaxStart.ajaxindicator': function() { // show tumble image }, 'ajaxStop.ajaxindicator': function() { // hide tumble image } });
  • 20. Selfdefined speeding $.extend(jQuery.fx.speeds, { slow: 600, fast: 200, // Default speed _default: 400 }, { slowmotion: 100, }); $('#clickme').click(function() { $('#book').fadeIn('slowmotion'); });
  • 22. jQuery plugins jQuery.error( msg ) jQuery.error = function( msg, code ) { var error = []; error[msg] = message; error['code'] = $errorcode; if (typeof console != undefined) { console.error(error) } throw msg; }
  • 23. jQuery UI $.extend('ui.autosuggest.prototype, { _search: function( value ) { // always save the actual value, // not the one passed as an argument this.term = this.element .addClass( "ui-autocomplete-loading" .val(); this.source( { term: value }, this.response ); });
  • 24. Sizzle.selectors jQuery.expr.filters jQuery.expr[':'] $.extend( $.expr.filters, { "myPseudoSelector": function( node, index, match ) { // return true, if s.th. Was selected // return false, if not. } });
  • 25. Book recommendation Jakob Westhoff http://westhoffswelt.de ISBN: 978-3-86802-052-6 E-Book-ISBN: 978-3-86802-237-7
  • 26. Feedback, pls Joind.in http://joind.in/talk/view/3511 Slides http://slideshare.net/lapistano Email lapistano@php.net IRC on freenode lapistano
  • 27. License This set of slides and the source code included in the download package is licensed under the Creative Commons Attribution- Noncommercial-Share Alike 2.0 Generic License http://creativecommons.org/licenses/by-nc-sa/2.0/deed.en