SlideShare a Scribd company logo
1 of 29
Download to read offline
jQuery and Standards
                  John Resig
 http://ejohn.org/ - http://twitter.com/jeresig
jQuery
✦   A JavaScript library designed to hide
    painful cross-browser compatibility issues
    while presenting a solid, usable, API.
Simple API
✦   $(“div > span”).addClass(“foo”);
    ✦ “Find some elements”
    ✦ “Do something with them”

✦   Makes complex manipulation of web pages
    simple
Space
✦   Highly competitive space
✦   Released Jan. 2006 - already a dominant
    player: Prototype JavaScript Library
✦   (Bundled with Ruby on Rails, had some
    nice coattail growth.)
✦   Other libraries: Dojo, Yahoo UI,
    MooTools
Specifications
✦   A few specifications that matter to us:
    ✦ DOM
    ✦ HTML
    ✦ CSS
    ✦ ECMAScript

✦   DOM more than anything else.
Concerns
✦   Performance.
✦   Performance.
✦   Performance.
✦   Usability.
✦   Any standards/browser addition that gives
    us performance benefits we’ll leap on.
New Standards We’ve Used
✦   Selectors API
    ✦ querySelectorAll

✦   Selectors API 2
    ✦ matchesSelector

✦   Animation Timing
    ✦ requestAnimationFrame

✦   ECMAScript
    ✦ bind
Selectors API
✦   A bit of a failure
✦   Didn’t listen to the needs of libraries
✦   Missed a number of important features/
    bug fixes:
    ✦ Contextual searching is messed up
    ✦ Error reporting is non-existent
    ✦ Implementations are inconsistent

✦   But it’s very fast, so we use it.
Matches Selector
✦   Selectors API 2 gave us matchesSelector
✦   We petitioned browsers to implement this
✦   They did, then it became a standard
✦   Makes our event delegation much faster
Smooth Animation
✦   requestAnimationFrame was created
✦   Scales animations based upon load
✦   Unfortunately this broke user expectations
    (expected certain frame rates)
✦   We just backed it out, will have to try
    again later
Needs
HTML string -> DOM support
✦   No good way to do this now
✦   Have to create a DOM element and use
    innerHTML
✦   Clunky and quite slow
✦   We want:
    ✦ someMethod(“<b>stuff</b>”) ->
      ✦ [ <b> ]
Access to event callbacks
✦   We want to be able to remove individual
    callbacks
✦   We want to be able to clone callbacks
✦   We want to be able to trigger specific
    callbacks
✦   All of this requires access to callbacks
An event for when stylesheets load
✦   Right now we have an event for DOM
    loaded
✦   And an event for window loaded
✦   But no event for when all the stylesheets
    load (important for looking at computed
    styles)
Will an element fire an event?
✦   For example - if I have a <form> element I
    want to be able to ask it:
    ✦ “Will you ever, natively, trigger a submit
      event?” (true)
✦   If I ask a <div> if it will trigger a submit
    event, it will return false.
Unique ID for DOM nodes
✦   We have to manage callbacks and data that
    we attach to DOM nodes
✦   To do this we have to assign the nodes a
    unique ID
✦   It’d be much better to have a property that
    took care of this for us
“Late Events”
✦   There is no way to ask the browser:
    ✦ “Did an event [foo] already fire on this
      element?”
✦   For example:
    ✦ Did the load event already fire on
      window?
    ✦ Did the submit event already fire on this
      form?
    ✦ etc.
Fast DOM mutation events
✦   I know this is being worked on right now
    (yay!)
✦   A way to have fast DOM mutation events
    would be awesome
✦   It could allow for some really slick
    restructuring of applications
✦   And make it easier for us to possibly do
    caching
mouseenter/mouseleave
✦   Internet Explorer provides these events
✦   They’re terribly useful (make it so that you
    don’t have to deal with event bubbling
    weirdness)
✦   Should be in browsers
✦   Need to verify DOM 3 Events spec
getComputedStyle
✦   A complete mess right now
✦   There is no consensus over what results
    should be returned and when
✦   There needs to be something declared
    here - probably a joint venture between
    the CSS and DOM working groups.
✦   Test suite for getComputedStyle
isCSSAuto
✦   There is no way of determining if a CSS
    property is currently set to “auto”
✦   This should be resolved, makes it much
    easier to do some types of animations
A way to sanely toggle visibility
✦   If we’re given an element that is display:
    none and we want to make it visible
    (display: block, perhaps)
✦   It is very hard to determine what the right
    “visible” style should be
✦   Especially if someone does:
    ✦ div { display: none; }

✦   Hint: It involves nasty use of iframes
contains() method
✦   We have compareDocumentPosition
✦   This is OK but contains() is very easy to
    use (in IE)
✦   Easy enough to implement, should be a
    standard
Better way of sorting nodes
✦   We have to use
    compareDocumentPosition now
✦   This is very very slow
✦   A numerical index property on nodes
    would be very useful (like in IE)
Is a node in an XML document
✦   A number of behaviors change when you’re
    in an XML document
✦   (IDs no longer resolve, some properties
    may not exist - like innerHTML, etc.)
✦   A way to determine if we’re working
    against an XML document would help
Support Tests
Questions?
✦   Questions?
    ✦ jeresig@gmail.com
    ✦ http://ejohn.org/
    ✦ http://twitter.com/jeresig

More Related Content

What's hot

JS-IL: Getting MEAN in 1 Hour
JS-IL: Getting MEAN in 1 HourJS-IL: Getting MEAN in 1 Hour
JS-IL: Getting MEAN in 1 HourValeri Karpov
 
Automated Testing with Cucumber, PhantomJS and Selenium
Automated Testing with Cucumber, PhantomJS and SeleniumAutomated Testing with Cucumber, PhantomJS and Selenium
Automated Testing with Cucumber, PhantomJS and SeleniumDev9Com
 
Isomorphic React Applications: Performance And Scalability
Isomorphic React Applications: Performance And ScalabilityIsomorphic React Applications: Performance And Scalability
Isomorphic React Applications: Performance And ScalabilityDenis Izmaylov
 
React server side rendering performance
React server side rendering performanceReact server side rendering performance
React server side rendering performanceNick Dreckshage
 
Алексей Швайка "Bundling: you are doing it wrong"
Алексей Швайка "Bundling: you are doing it wrong"Алексей Швайка "Bundling: you are doing it wrong"
Алексей Швайка "Bundling: you are doing it wrong"Fwdays
 
Grokking #9: Building a real-time and offline editing service with Couchbase
Grokking #9: Building a real-time and offline editing service with CouchbaseGrokking #9: Building a real-time and offline editing service with Couchbase
Grokking #9: Building a real-time and offline editing service with CouchbaseOliver N
 
The fundamental problems of GUI applications and why people choose React
The fundamental problems of GUI applications and why people choose ReactThe fundamental problems of GUI applications and why people choose React
The fundamental problems of GUI applications and why people choose ReactOliver N
 
PHP Indonesia - Nodejs Web Development
PHP Indonesia - Nodejs Web DevelopmentPHP Indonesia - Nodejs Web Development
PHP Indonesia - Nodejs Web DevelopmentIrfan Maulana
 
MEAN Stack WeNode Barcelona Workshop
MEAN Stack WeNode Barcelona WorkshopMEAN Stack WeNode Barcelona Workshop
MEAN Stack WeNode Barcelona WorkshopValeri Karpov
 
NodeSummit - MEAN Stack
NodeSummit - MEAN StackNodeSummit - MEAN Stack
NodeSummit - MEAN StackValeri Karpov
 
Drupal, Android and iPhone
Drupal, Android and iPhoneDrupal, Android and iPhone
Drupal, Android and iPhoneAlexandru Badiu
 
Module, AMD, RequireJS
Module, AMD, RequireJSModule, AMD, RequireJS
Module, AMD, RequireJS偉格 高
 
Capybara testing
Capybara testingCapybara testing
Capybara testingFutureworkz
 
Modern Web Development in 2015
Modern Web Development in 2015Modern Web Development in 2015
Modern Web Development in 2015Oliver N
 
Production optimization with React and Webpack
Production optimization with React and WebpackProduction optimization with React and Webpack
Production optimization with React and Webpackk88hudson
 
In-browser storage and me
In-browser storage and meIn-browser storage and me
In-browser storage and meJason Casden
 
Blazor - An Introduction
Blazor - An IntroductionBlazor - An Introduction
Blazor - An IntroductionJamieTaylor112
 
Writing Software not Code with Cucumber
Writing Software not Code with CucumberWriting Software not Code with Cucumber
Writing Software not Code with CucumberBen Mabey
 
Tek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJSTek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJSPablo Godel
 

What's hot (20)

JS-IL: Getting MEAN in 1 Hour
JS-IL: Getting MEAN in 1 HourJS-IL: Getting MEAN in 1 Hour
JS-IL: Getting MEAN in 1 Hour
 
Automated Testing with Cucumber, PhantomJS and Selenium
Automated Testing with Cucumber, PhantomJS and SeleniumAutomated Testing with Cucumber, PhantomJS and Selenium
Automated Testing with Cucumber, PhantomJS and Selenium
 
Isomorphic React Applications: Performance And Scalability
Isomorphic React Applications: Performance And ScalabilityIsomorphic React Applications: Performance And Scalability
Isomorphic React Applications: Performance And Scalability
 
React server side rendering performance
React server side rendering performanceReact server side rendering performance
React server side rendering performance
 
Алексей Швайка "Bundling: you are doing it wrong"
Алексей Швайка "Bundling: you are doing it wrong"Алексей Швайка "Bundling: you are doing it wrong"
Алексей Швайка "Bundling: you are doing it wrong"
 
Grokking #9: Building a real-time and offline editing service with Couchbase
Grokking #9: Building a real-time and offline editing service with CouchbaseGrokking #9: Building a real-time and offline editing service with Couchbase
Grokking #9: Building a real-time and offline editing service with Couchbase
 
The fundamental problems of GUI applications and why people choose React
The fundamental problems of GUI applications and why people choose ReactThe fundamental problems of GUI applications and why people choose React
The fundamental problems of GUI applications and why people choose React
 
PHP Indonesia - Nodejs Web Development
PHP Indonesia - Nodejs Web DevelopmentPHP Indonesia - Nodejs Web Development
PHP Indonesia - Nodejs Web Development
 
MEAN Stack WeNode Barcelona Workshop
MEAN Stack WeNode Barcelona WorkshopMEAN Stack WeNode Barcelona Workshop
MEAN Stack WeNode Barcelona Workshop
 
NodeSummit - MEAN Stack
NodeSummit - MEAN StackNodeSummit - MEAN Stack
NodeSummit - MEAN Stack
 
Drupal, Android and iPhone
Drupal, Android and iPhoneDrupal, Android and iPhone
Drupal, Android and iPhone
 
Module, AMD, RequireJS
Module, AMD, RequireJSModule, AMD, RequireJS
Module, AMD, RequireJS
 
Capybara testing
Capybara testingCapybara testing
Capybara testing
 
Modern Web Development in 2015
Modern Web Development in 2015Modern Web Development in 2015
Modern Web Development in 2015
 
Production optimization with React and Webpack
Production optimization with React and WebpackProduction optimization with React and Webpack
Production optimization with React and Webpack
 
JavaScript Web Workers
JavaScript Web WorkersJavaScript Web Workers
JavaScript Web Workers
 
In-browser storage and me
In-browser storage and meIn-browser storage and me
In-browser storage and me
 
Blazor - An Introduction
Blazor - An IntroductionBlazor - An Introduction
Blazor - An Introduction
 
Writing Software not Code with Cucumber
Writing Software not Code with CucumberWriting Software not Code with Cucumber
Writing Software not Code with Cucumber
 
Tek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJSTek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJS
 

Similar to jQuery Recommendations to the W3C (2011)

Web Components at Scale, HTML5DevConf 2014-10-21
Web Components at Scale, HTML5DevConf 2014-10-21Web Components at Scale, HTML5DevConf 2014-10-21
Web Components at Scale, HTML5DevConf 2014-10-21Chris Danford
 
Backbone/Marionette introduction
Backbone/Marionette introductionBackbone/Marionette introduction
Backbone/Marionette introductionmatt-briggs
 
Deep crawl the chaotic landscape of JavaScript
Deep crawl the chaotic landscape of JavaScript Deep crawl the chaotic landscape of JavaScript
Deep crawl the chaotic landscape of JavaScript Onely
 
Progressive Web Apps. What, why and how
Progressive Web Apps. What, why and howProgressive Web Apps. What, why and how
Progressive Web Apps. What, why and howRiza Fahmi
 
"Progressive Web Apps" by Riza Fahmi (Hacktiv8)
"Progressive Web Apps" by Riza Fahmi	(Hacktiv8)"Progressive Web Apps" by Riza Fahmi	(Hacktiv8)
"Progressive Web Apps" by Riza Fahmi (Hacktiv8)Tech in Asia ID
 
John Resig Beijing 2010 (English Version)
John Resig Beijing 2010 (English Version)John Resig Beijing 2010 (English Version)
John Resig Beijing 2010 (English Version)Jia Mi
 
APIs for modern web apps
APIs for modern web appsAPIs for modern web apps
APIs for modern web appsChris Mills
 
jQuery Features to Avoid
jQuery Features to AvoidjQuery Features to Avoid
jQuery Features to Avoiddmethvin
 
jQuery Conference Austin Sept 2013
jQuery Conference Austin Sept 2013jQuery Conference Austin Sept 2013
jQuery Conference Austin Sept 2013dmethvin
 
GDD Japan 2009 - Designing OpenSocial Apps For Speed and Scale
GDD Japan 2009 - Designing OpenSocial Apps For Speed and ScaleGDD Japan 2009 - Designing OpenSocial Apps For Speed and Scale
GDD Japan 2009 - Designing OpenSocial Apps For Speed and ScalePatrick Chanezon
 
Upstate CSCI 450 jQuery
Upstate CSCI 450 jQueryUpstate CSCI 450 jQuery
Upstate CSCI 450 jQueryDanWooster1
 
jQuery Conference 2012 keynote
jQuery Conference 2012 keynotejQuery Conference 2012 keynote
jQuery Conference 2012 keynotedmethvin
 
You Can Work on the Web Patform! (GOSIM 2023)
You Can Work on the Web Patform! (GOSIM 2023)You Can Work on the Web Patform! (GOSIM 2023)
You Can Work on the Web Patform! (GOSIM 2023)Igalia
 
Creating a Responsive Website From Scratch
Creating a Responsive Website From ScratchCreating a Responsive Website From Scratch
Creating a Responsive Website From ScratchCorky Brown
 
JavaScript SEO: Testing and Debugging for Non-Developers - Search Marketing S...
JavaScript SEO: Testing and Debugging for Non-Developers - Search Marketing S...JavaScript SEO: Testing and Debugging for Non-Developers - Search Marketing S...
JavaScript SEO: Testing and Debugging for Non-Developers - Search Marketing S...Leigh Hanney
 
State of jQuery June 2013 - Portland
State of jQuery June 2013 - PortlandState of jQuery June 2013 - Portland
State of jQuery June 2013 - Portlanddmethvin
 
NinjaScript 2010-10-14
NinjaScript 2010-10-14NinjaScript 2010-10-14
NinjaScript 2010-10-14lrdesign
 
"Crafting a Third-Party Banking Library with Web Components and React", Germa...
"Crafting a Third-Party Banking Library with Web Components and React", Germa..."Crafting a Third-Party Banking Library with Web Components and React", Germa...
"Crafting a Third-Party Banking Library with Web Components and React", Germa...Fwdays
 
External JavaScript Widget Development Best Practices (updated) (v.1.1)
External JavaScript Widget Development Best Practices (updated) (v.1.1) External JavaScript Widget Development Best Practices (updated) (v.1.1)
External JavaScript Widget Development Best Practices (updated) (v.1.1) Volkan Özçelik
 

Similar to jQuery Recommendations to the W3C (2011) (20)

Web Components at Scale, HTML5DevConf 2014-10-21
Web Components at Scale, HTML5DevConf 2014-10-21Web Components at Scale, HTML5DevConf 2014-10-21
Web Components at Scale, HTML5DevConf 2014-10-21
 
Backbone/Marionette introduction
Backbone/Marionette introductionBackbone/Marionette introduction
Backbone/Marionette introduction
 
Deep crawl the chaotic landscape of JavaScript
Deep crawl the chaotic landscape of JavaScript Deep crawl the chaotic landscape of JavaScript
Deep crawl the chaotic landscape of JavaScript
 
Progressive Web Apps. What, why and how
Progressive Web Apps. What, why and howProgressive Web Apps. What, why and how
Progressive Web Apps. What, why and how
 
"Progressive Web Apps" by Riza Fahmi (Hacktiv8)
"Progressive Web Apps" by Riza Fahmi	(Hacktiv8)"Progressive Web Apps" by Riza Fahmi	(Hacktiv8)
"Progressive Web Apps" by Riza Fahmi (Hacktiv8)
 
John Resig Beijing 2010 (English Version)
John Resig Beijing 2010 (English Version)John Resig Beijing 2010 (English Version)
John Resig Beijing 2010 (English Version)
 
APIs for modern web apps
APIs for modern web appsAPIs for modern web apps
APIs for modern web apps
 
jQuery Features to Avoid
jQuery Features to AvoidjQuery Features to Avoid
jQuery Features to Avoid
 
jQuery Conference Austin Sept 2013
jQuery Conference Austin Sept 2013jQuery Conference Austin Sept 2013
jQuery Conference Austin Sept 2013
 
GDD Japan 2009 - Designing OpenSocial Apps For Speed and Scale
GDD Japan 2009 - Designing OpenSocial Apps For Speed and ScaleGDD Japan 2009 - Designing OpenSocial Apps For Speed and Scale
GDD Japan 2009 - Designing OpenSocial Apps For Speed and Scale
 
Angular js
Angular jsAngular js
Angular js
 
Upstate CSCI 450 jQuery
Upstate CSCI 450 jQueryUpstate CSCI 450 jQuery
Upstate CSCI 450 jQuery
 
jQuery Conference 2012 keynote
jQuery Conference 2012 keynotejQuery Conference 2012 keynote
jQuery Conference 2012 keynote
 
You Can Work on the Web Patform! (GOSIM 2023)
You Can Work on the Web Patform! (GOSIM 2023)You Can Work on the Web Patform! (GOSIM 2023)
You Can Work on the Web Patform! (GOSIM 2023)
 
Creating a Responsive Website From Scratch
Creating a Responsive Website From ScratchCreating a Responsive Website From Scratch
Creating a Responsive Website From Scratch
 
JavaScript SEO: Testing and Debugging for Non-Developers - Search Marketing S...
JavaScript SEO: Testing and Debugging for Non-Developers - Search Marketing S...JavaScript SEO: Testing and Debugging for Non-Developers - Search Marketing S...
JavaScript SEO: Testing and Debugging for Non-Developers - Search Marketing S...
 
State of jQuery June 2013 - Portland
State of jQuery June 2013 - PortlandState of jQuery June 2013 - Portland
State of jQuery June 2013 - Portland
 
NinjaScript 2010-10-14
NinjaScript 2010-10-14NinjaScript 2010-10-14
NinjaScript 2010-10-14
 
"Crafting a Third-Party Banking Library with Web Components and React", Germa...
"Crafting a Third-Party Banking Library with Web Components and React", Germa..."Crafting a Third-Party Banking Library with Web Components and React", Germa...
"Crafting a Third-Party Banking Library with Web Components and React", Germa...
 
External JavaScript Widget Development Best Practices (updated) (v.1.1)
External JavaScript Widget Development Best Practices (updated) (v.1.1) External JavaScript Widget Development Best Practices (updated) (v.1.1)
External JavaScript Widget Development Best Practices (updated) (v.1.1)
 

More from jeresig

Does Coding Every Day Matter?
Does Coding Every Day Matter?Does Coding Every Day Matter?
Does Coding Every Day Matter?jeresig
 
Accidentally Becoming a Digital Librarian
Accidentally Becoming a Digital LibrarianAccidentally Becoming a Digital Librarian
Accidentally Becoming a Digital Librarianjeresig
 
2014: John's Favorite Thing (Neo4j)
2014: John's Favorite Thing (Neo4j)2014: John's Favorite Thing (Neo4j)
2014: John's Favorite Thing (Neo4j)jeresig
 
Computer Vision as Art Historical Investigation
Computer Vision as Art Historical InvestigationComputer Vision as Art Historical Investigation
Computer Vision as Art Historical Investigationjeresig
 
Hacking Art History
Hacking Art HistoryHacking Art History
Hacking Art Historyjeresig
 
Using JS to teach JS at Khan Academy
Using JS to teach JS at Khan AcademyUsing JS to teach JS at Khan Academy
Using JS to teach JS at Khan Academyjeresig
 
Applying Computer Vision to Art History
Applying Computer Vision to Art HistoryApplying Computer Vision to Art History
Applying Computer Vision to Art Historyjeresig
 
NYARC 2014: Frick/Zeri Results
NYARC 2014: Frick/Zeri ResultsNYARC 2014: Frick/Zeri Results
NYARC 2014: Frick/Zeri Resultsjeresig
 
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image AnalysisEmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysisjeresig
 
Applying Computer Vision to Art History
Applying Computer Vision to Art HistoryApplying Computer Vision to Art History
Applying Computer Vision to Art Historyjeresig
 
JavaScript Libraries (Ajax Exp 2006)
JavaScript Libraries (Ajax Exp 2006)JavaScript Libraries (Ajax Exp 2006)
JavaScript Libraries (Ajax Exp 2006)jeresig
 
Introduction to jQuery (Ajax Exp 2006)
Introduction to jQuery (Ajax Exp 2006)Introduction to jQuery (Ajax Exp 2006)
Introduction to jQuery (Ajax Exp 2006)jeresig
 
jQuery Open Source Process (RIT 2011)
jQuery Open Source Process (RIT 2011)jQuery Open Source Process (RIT 2011)
jQuery Open Source Process (RIT 2011)jeresig
 
jQuery Open Source Process (Knight Foundation 2011)
jQuery Open Source Process (Knight Foundation 2011)jQuery Open Source Process (Knight Foundation 2011)
jQuery Open Source Process (Knight Foundation 2011)jeresig
 
jQuery Mobile
jQuery MobilejQuery Mobile
jQuery Mobilejeresig
 
jQuery Open Source (Fronteer 2011)
jQuery Open Source (Fronteer 2011)jQuery Open Source (Fronteer 2011)
jQuery Open Source (Fronteer 2011)jeresig
 
Introduction to jQuery (Ajax Exp 2007)
Introduction to jQuery (Ajax Exp 2007)Introduction to jQuery (Ajax Exp 2007)
Introduction to jQuery (Ajax Exp 2007)jeresig
 
Advanced jQuery (Ajax Exp 2007)
Advanced jQuery (Ajax Exp 2007)Advanced jQuery (Ajax Exp 2007)
Advanced jQuery (Ajax Exp 2007)jeresig
 
JavaScript Library Overview (Ajax Exp West 2007)
JavaScript Library Overview (Ajax Exp West 2007)JavaScript Library Overview (Ajax Exp West 2007)
JavaScript Library Overview (Ajax Exp West 2007)jeresig
 
Meta Programming with JavaScript
Meta Programming with JavaScriptMeta Programming with JavaScript
Meta Programming with JavaScriptjeresig
 

More from jeresig (20)

Does Coding Every Day Matter?
Does Coding Every Day Matter?Does Coding Every Day Matter?
Does Coding Every Day Matter?
 
Accidentally Becoming a Digital Librarian
Accidentally Becoming a Digital LibrarianAccidentally Becoming a Digital Librarian
Accidentally Becoming a Digital Librarian
 
2014: John's Favorite Thing (Neo4j)
2014: John's Favorite Thing (Neo4j)2014: John's Favorite Thing (Neo4j)
2014: John's Favorite Thing (Neo4j)
 
Computer Vision as Art Historical Investigation
Computer Vision as Art Historical InvestigationComputer Vision as Art Historical Investigation
Computer Vision as Art Historical Investigation
 
Hacking Art History
Hacking Art HistoryHacking Art History
Hacking Art History
 
Using JS to teach JS at Khan Academy
Using JS to teach JS at Khan AcademyUsing JS to teach JS at Khan Academy
Using JS to teach JS at Khan Academy
 
Applying Computer Vision to Art History
Applying Computer Vision to Art HistoryApplying Computer Vision to Art History
Applying Computer Vision to Art History
 
NYARC 2014: Frick/Zeri Results
NYARC 2014: Frick/Zeri ResultsNYARC 2014: Frick/Zeri Results
NYARC 2014: Frick/Zeri Results
 
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image AnalysisEmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
 
Applying Computer Vision to Art History
Applying Computer Vision to Art HistoryApplying Computer Vision to Art History
Applying Computer Vision to Art History
 
JavaScript Libraries (Ajax Exp 2006)
JavaScript Libraries (Ajax Exp 2006)JavaScript Libraries (Ajax Exp 2006)
JavaScript Libraries (Ajax Exp 2006)
 
Introduction to jQuery (Ajax Exp 2006)
Introduction to jQuery (Ajax Exp 2006)Introduction to jQuery (Ajax Exp 2006)
Introduction to jQuery (Ajax Exp 2006)
 
jQuery Open Source Process (RIT 2011)
jQuery Open Source Process (RIT 2011)jQuery Open Source Process (RIT 2011)
jQuery Open Source Process (RIT 2011)
 
jQuery Open Source Process (Knight Foundation 2011)
jQuery Open Source Process (Knight Foundation 2011)jQuery Open Source Process (Knight Foundation 2011)
jQuery Open Source Process (Knight Foundation 2011)
 
jQuery Mobile
jQuery MobilejQuery Mobile
jQuery Mobile
 
jQuery Open Source (Fronteer 2011)
jQuery Open Source (Fronteer 2011)jQuery Open Source (Fronteer 2011)
jQuery Open Source (Fronteer 2011)
 
Introduction to jQuery (Ajax Exp 2007)
Introduction to jQuery (Ajax Exp 2007)Introduction to jQuery (Ajax Exp 2007)
Introduction to jQuery (Ajax Exp 2007)
 
Advanced jQuery (Ajax Exp 2007)
Advanced jQuery (Ajax Exp 2007)Advanced jQuery (Ajax Exp 2007)
Advanced jQuery (Ajax Exp 2007)
 
JavaScript Library Overview (Ajax Exp West 2007)
JavaScript Library Overview (Ajax Exp West 2007)JavaScript Library Overview (Ajax Exp West 2007)
JavaScript Library Overview (Ajax Exp West 2007)
 
Meta Programming with JavaScript
Meta Programming with JavaScriptMeta Programming with JavaScript
Meta Programming with JavaScript
 

jQuery Recommendations to the W3C (2011)

  • 1. jQuery and Standards John Resig http://ejohn.org/ - http://twitter.com/jeresig
  • 2. jQuery ✦ A JavaScript library designed to hide painful cross-browser compatibility issues while presenting a solid, usable, API.
  • 3. Simple API ✦ $(“div > span”).addClass(“foo”); ✦ “Find some elements” ✦ “Do something with them” ✦ Makes complex manipulation of web pages simple
  • 4. Space ✦ Highly competitive space ✦ Released Jan. 2006 - already a dominant player: Prototype JavaScript Library ✦ (Bundled with Ruby on Rails, had some nice coattail growth.) ✦ Other libraries: Dojo, Yahoo UI, MooTools
  • 5.
  • 6.
  • 7. Specifications ✦ A few specifications that matter to us: ✦ DOM ✦ HTML ✦ CSS ✦ ECMAScript ✦ DOM more than anything else.
  • 8. Concerns ✦ Performance. ✦ Performance. ✦ Performance. ✦ Usability. ✦ Any standards/browser addition that gives us performance benefits we’ll leap on.
  • 9. New Standards We’ve Used ✦ Selectors API ✦ querySelectorAll ✦ Selectors API 2 ✦ matchesSelector ✦ Animation Timing ✦ requestAnimationFrame ✦ ECMAScript ✦ bind
  • 10. Selectors API ✦ A bit of a failure ✦ Didn’t listen to the needs of libraries ✦ Missed a number of important features/ bug fixes: ✦ Contextual searching is messed up ✦ Error reporting is non-existent ✦ Implementations are inconsistent ✦ But it’s very fast, so we use it.
  • 11. Matches Selector ✦ Selectors API 2 gave us matchesSelector ✦ We petitioned browsers to implement this ✦ They did, then it became a standard ✦ Makes our event delegation much faster
  • 12. Smooth Animation ✦ requestAnimationFrame was created ✦ Scales animations based upon load ✦ Unfortunately this broke user expectations (expected certain frame rates) ✦ We just backed it out, will have to try again later
  • 13. Needs
  • 14. HTML string -> DOM support ✦ No good way to do this now ✦ Have to create a DOM element and use innerHTML ✦ Clunky and quite slow ✦ We want: ✦ someMethod(“<b>stuff</b>”) -> ✦ [ <b> ]
  • 15. Access to event callbacks ✦ We want to be able to remove individual callbacks ✦ We want to be able to clone callbacks ✦ We want to be able to trigger specific callbacks ✦ All of this requires access to callbacks
  • 16. An event for when stylesheets load ✦ Right now we have an event for DOM loaded ✦ And an event for window loaded ✦ But no event for when all the stylesheets load (important for looking at computed styles)
  • 17. Will an element fire an event? ✦ For example - if I have a <form> element I want to be able to ask it: ✦ “Will you ever, natively, trigger a submit event?” (true) ✦ If I ask a <div> if it will trigger a submit event, it will return false.
  • 18. Unique ID for DOM nodes ✦ We have to manage callbacks and data that we attach to DOM nodes ✦ To do this we have to assign the nodes a unique ID ✦ It’d be much better to have a property that took care of this for us
  • 19. “Late Events” ✦ There is no way to ask the browser: ✦ “Did an event [foo] already fire on this element?” ✦ For example: ✦ Did the load event already fire on window? ✦ Did the submit event already fire on this form? ✦ etc.
  • 20. Fast DOM mutation events ✦ I know this is being worked on right now (yay!) ✦ A way to have fast DOM mutation events would be awesome ✦ It could allow for some really slick restructuring of applications ✦ And make it easier for us to possibly do caching
  • 21. mouseenter/mouseleave ✦ Internet Explorer provides these events ✦ They’re terribly useful (make it so that you don’t have to deal with event bubbling weirdness) ✦ Should be in browsers ✦ Need to verify DOM 3 Events spec
  • 22. getComputedStyle ✦ A complete mess right now ✦ There is no consensus over what results should be returned and when ✦ There needs to be something declared here - probably a joint venture between the CSS and DOM working groups. ✦ Test suite for getComputedStyle
  • 23. isCSSAuto ✦ There is no way of determining if a CSS property is currently set to “auto” ✦ This should be resolved, makes it much easier to do some types of animations
  • 24. A way to sanely toggle visibility ✦ If we’re given an element that is display: none and we want to make it visible (display: block, perhaps) ✦ It is very hard to determine what the right “visible” style should be ✦ Especially if someone does: ✦ div { display: none; } ✦ Hint: It involves nasty use of iframes
  • 25. contains() method ✦ We have compareDocumentPosition ✦ This is OK but contains() is very easy to use (in IE) ✦ Easy enough to implement, should be a standard
  • 26. Better way of sorting nodes ✦ We have to use compareDocumentPosition now ✦ This is very very slow ✦ A numerical index property on nodes would be very useful (like in IE)
  • 27. Is a node in an XML document ✦ A number of behaviors change when you’re in an XML document ✦ (IDs no longer resolve, some properties may not exist - like innerHTML, etc.) ✦ A way to determine if we’re working against an XML document would help
  • 29. Questions? ✦ Questions? ✦ jeresig@gmail.com ✦ http://ejohn.org/ ✦ http://twitter.com/jeresig