The jQuery Foundation and Standards

Posted on by

Most web developers think about jQuery in terms of its roots, as a library that tries to bring sanity to a disparate set of APIs and quirks that vary from browser to browser. Although that’s one of the things that jQuery was built to do, and still does, it’s not the only thing. jQuery defines a useful API that makes it as easy to work with one element as it does for a dozen. jQuery shortens verbose DOM API names and removes tedious boilerplate code, making it easier to write and to read code. jQuery adds functionality beyond the standard APIs for the work that web developers often need to do.

In short, jQuery isn’t just an API repairman for browsers. To the extent that we need to fix problems, we do it. But we’re even more interested in getting browsers to fix their problems, and in shaping future standards to avoid problems, so native APIs will work properly from the start. Then we can all build useful functionality on top of that solid foundation.

jQuery team members bring plenty of real-world experience that guide standards in the right direction. The earliest example of this is the querySelectorAll method, where John Resig pointed out that the implementation wasn’t quite what JavaScript developers needed. Unfortunately in the case of querySelectorAll, it was too late to do anything to fix the problems.

How jQuery Can Shape Standards

In order to provide input into emerging standards, the jQuery Foundation joined the World Wide Web Consortium (W3C) and ECMA International last year. In fact, it’s one of the main reasons the Foundation was formed. W3C and ECMA members tend to be representatives of the companies that make browsers and commercial software. We believe that we bring the voice of the rank-and-file web developer to the standards process.

Yehuda Katz and Rick Waldron have been active in the ECMA TC39 group, which defines the language officially known as EcmaScript but that we know as JavaScript. Rick’s excellent meeting notes can give you an inside view of the deliberations that go on during their in-person meetings.

Scott González and Kris Borchers have been working to refine the Pointer Events standard. It brings simplicity, regularity, and sanity to the handling of pointer technologies so that developers don’t have inconsistent (and conflicting!) event models for touch and mouse. During the transition, developers will be dealing with three pointer models–mouse, touch, and pointer. jQuery and jQuery UI want to simplify this transition to the standard.

Julian Aubourg has been participating on revisions to the XMLHttpRequest standard, a position for which he’s been battle-tested by jQuery’s $.ajax implementation. Knowing all the problems that jQuery has worked around provides him with experience to avoid the same problems in the future.

Scott González and TJ VanToll have been active in helping to define HTML5 input types such as <input type=”date”>, providing practical input based on experience with jQuery UI. TJ’s talk at the Portland jQuery Conference does a great job of covering the pitfalls of using HTML5 input types today, and emerging standards like Web Components that could make things easier for web developers.

The jQuery Foundation is also a strong advocate of accessibility; we want to make it easy for web developers to reach all users including those with vision or motor impairments. The W3C addresses those issues through the Web Accessibility Initiative, and specifically with Accessible Rich Internet Applications (ARIA). jQuery UI widgets are incorporating ARIA attributes, and Foundation member Deque Systems has sponsored several events on jQuery accessibility issues.

Finally, we coordinate and pass along bugs reported to jQuery that are due to standards violations in a particular browser. With most browsers updating every few months, it often doesn’t make sense for jQuery to incorporate large and complex bug fixes for temporary problems. But we’re committed to getting them fixed by the browser makers as soon as possible.

A Standards-Driven jQuery Future

jQuery isn’t a highly opinionated framework that demands control over all the DOM. In most cases you can (and often should) use the DOM APIs alongside jQuery. That was always the intended design; you can see it in aspects like the this object inside an event handler being a DOM element, not a jQuery object. About the only place where jQuery requires control is when elements in the DOM are replaced via methods like .html() or removed with a method like .empty(), so that any associated jQuery data can be cleared out.

Similarly, the built-in HTML5 input types can coexist with jQuery UI input widgets. jQuery UI is committed to providing user interface widgets that provide great functionality without sacrificing accessibility, inherently supporting standards such as ARIA.

The jQuery Foundation wants standards-based APIs and cutting-edge JavaScript features to be usable directly by developers. The good news is that the community is making good progress on that goal, and jQuery team members are helping through our participation in the standards process. Yet the continuing evolution of web standards and practices, combined with a vibrant third-party ecosystem of plugins and knowledge, still provide compelling reasons to use jQuery. Web developers deserve to have the best of both.

Comments are closed.