JavaScript, Ajax and the DOM

The resurgence of the use of JavaScript, and the increased level of sophistication in its employment on the web is nothing short of spectacular. After an early surge of enthusiasm in the mid to late 1990s, JavaScript remained largely confined to effects and gimmicks, until the rise of Ajax and various libraries and frameworks. That the majority of our respondents consider themselves “developers” not “designers” is testimony to how important JavaScript and Ajax have become.

In this section, we tried to get an understanding of the extent to which respondents used JavaScript (if at all), and how they used JavaScript.

Do they use JavaScript?

In response to the question “Do you use JavaScript in your development?”, only 5% replied no. 73% replied that they use it for visual effects, 61% for form validation, 42% for complex application interaction, and over half for Ajaxian communication between client and server (respondents could give multiple answers).

Both the overall percentage of JavaScript users (95%), and the level of sophistication they are using the language for reflect not only the prominence of JavaScript as part of these respondents tools, but also the nature of web development generally today. The days of the static page based web site are definitely on the way out, and the day of the web application is on the rise.

Do you use JavaScript in your development?
For visual effects90273.10%
For form validation75461.10%
For complex application interaction52042.14%
For Ajax communication with the server65953.40%

JavaScript Use

We followed up with some questions about developers’ methodologies when it comes to using JavaScript.

JavaScript coding practices

First up, we asked “Do you separate your JavaScript from your markup (“unobtrusive JavaScript”)?”, a recommended practice. Just under 4% of developers said no, while 39% said always, and 42% said usually. It’s clear that respondents are at least on the whole aware of this recommended practice.

Do you separate your JavaScript from your markup?
No answer826.65%
Non completed1108.91%

We also asked “Do you strictly adhere to the W3C DOM, and avoid browser specific extensions?”. Again only around 4% answered in the negative, while half answered “as much as possible”, and just under a third “always”.

Only about 9% of respondents answered the follow up question “What non W3C DOM methods or properties do you use regularly?” Unsurprisingly, innerHTML tops the list at around 40% of these respondents. At about 7% is xmlHttpRequest. The latter is currently a draft specification from the W3C, while innerHTML is a proposed addition to HTML 5. About 17% of these respondents specifically mentioned working around Internet Explorer bugs, or lack of support of aspects of the W3 DOM. Like all the other questions which asked for further information from respondents, the full responses are available in the CSV of the survey results.

Do you strictly adhere to the W3C DOM, and avoid browser specific extensions?
As much as possible61349.68%
No answer836.73%
Non completed1108.91%
Libraries and Frameworks

The resurgence of the use of JavaScript has gone hand in hand with the rise of robust, sophisticated JavaScript libraries like JQuery, Dojo and YUI. To get a sense of whether developers are using these libraries, and which ones, we asked “Which JavaScript libraries and frameworks do you use?”, with options for a dozen of the most well known libraries, and the option too of listing other libraries used.

10% of respondents replied that they used no libraries, suggesting that as many as 95% of developers who use JavaScript use libraries to some extent.

In terms of which libraries were used (respondents could list more than one library), JQuery dominates among these respondents, with 63% of developers answering that they use it. Other commonly used libraries include Prototype at 23%, Mootools at 19%, Script​.aculo​.us at 18%, and YUI at 11%. In this survey, no other library gained a share of more than 3%.

Of the “other” libraries used (a total of just on 4% of respondents answered other), only Adobe’s Spry, with a total of 11, or about 1%, had any non trivial number of respondents.

Which JavaScript libraries and frameworks do you use?

JavaScript library market share

It’s clear that in just a few short years, JavaScript has gone from something used sparingly to add a little interaction or some effects to sites, to a key technology for web professionals.


Next we’ll take a look at how respondents use embedded content like Flash and Silverlight which require browser plug-​​ins.