JavaScript, Ajax and the DOM

In the introduction to this section of our report last year, we made the following observations, which are only reinforced by this year’s survey.

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 4% (last survey 5.3%) replied no. 77% (up from 73%) replied that they use it for visual effects, 66% (61%) for form validation, 48% (42%) for complex application interaction, and 58% (53%) for “Ajaxian communication between client and server” (respondents could give multiple answers).

Both the overall percentage of JavaScript users (96%), 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.

Question 35: Do you use JavaScript in your development?

2010
AnswerCount%
No563.99%
For visual effects107776.82%
For form validation92666.05%
For complex application interaction68348.72%
For Ajax communication with the server81858.35%
2008
AnswerCount%
No655.27%
For visual effects90273.10%
For form validation75461.10%
For complex application interaction52042.14%
For Ajax communication with the server65953.40%
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, Prototype and YUI. To get a sense of whether developers are using these libraries, and which ones, we once again 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.

The big stories here are

  • the small number of respondents who use no library (down from 9.6% to only 3.9% in this survey — effectively all our respondents use JavaScript, and all those who do use one or more libraries)
  • JQuery, already dominant last year with 63% of all respondents using it has increased strongly to a 78% adoption rate by respondents.
  • Of the other libraries, only YUI (11.5% from 10.8%), and Ext (2.8% up from 2.7%) saw an increase in percentage use by respondents, Dojo stayed steady at 2.9%, and all others fell
  • Despite these changes, the ranking from most used to least used stayed essentially unchanged

Which JavaScript libraries and frameworks do you use?

2010
FrameworkCount%
None553.92%
Backbase10.07%
Dojo412.92%
Ext392.78%
GWT130.93%
JQuery109177.82%
Mootools19613.98%
Prototype24917.76%
qooxdoo20.14%
script​.aculo​.us18713.34%
YUI16111.48%
Other433.07%
2008
FrameworkCount%
None1199.64%
Backbase20.16%
Dojo362.92%
Ext332.67%
GWT161.30%
JQuery77562.80%
Mootools23519.04%
Prototype28723.26%
qooxdoo10.08%
script​.aculo​.us22418.15%
YUI13310.78%
Other504.05%

In addition to choosing from a list of th emost common libraries, we gave respondents the opportunity to name other libraries they use. Interestingly, despite gaining considerable coverage in the last year or so, the fully fledged application development focussed libraries Cappucino and Sproutcore each only were mentioned once. These libraries are much more geared toward desktop-​​like applications in the browser than more “low level” libraries like most of those listed above. It remains to be seen whether in subsequent surveys use of these libraries increases, or whether developers aren’t particularly interested in building desktop-​​like applications for the web.

HTML 5

Since our 2008 survey, HTML5 has gone from a promising, atalked about technology, to having quite wide support of various features in several contemporary browsers. It’s particularly well adopted in the browsers on mobile devices like the iPhone, and Android. To get a sense of how much the API features, as opposed to markup features of HTML5 are being used, we asked a couple of questions regarding their use in this year’s survey. Note to the pedants that we are aware that some of these APIs are not technically part of HTML5, and others have never been so, but we use HTML5 here as an umbrella term for new, browser based technologies.

Only fewer than 10% of our respondents say that they are working with these APIs. However, given their still limited support, and their only recent availability, that they have similar levels of adoption to SVG and Canvas is notable.

Of those APIs developers mentioned using, a little under a half (45%) use geolocation APIs, around a third (31%) client side storage, while web workers, websockets, drag and drop and the file API all are mentioned by a handful of developers at most.

Geolocation and client side storage are particularly relevant to mobile devices, so as we see mobile web use increase, and an increasing focus on optimizing for or targetting the mobile web user, we’d expect to see the use of those two technologies in particular grow strongly.

Do you use HTML5 APIs (geolocation, client side storage, webworkers etc)?

2010
AnswerCount%
Yes1289.13%
No112179.96%

If so, which APIs do you use

2010
APICount%
geolocation5745%
client side storage4031%
web workers43%
drag and drop32.3%
file api21.6%
websockets21.6%
JavaScript coding practices

Like last year, we also asked some questions about developers’ scripting methodologies.

Do you separate your JavaScript from your markup (“unobtrusive JavaScript”)?

Unlike the message of separating presentation from markup, developers are somewhat less likely to practice “unobtrusive JavaScript”, with similar numbers this year when it came to that question.

2010
AnswerCount%
Always61443.79%
Usually52937.73%
No563.99%
2008
AnswerCount%
Always47738.65%
Usually51841.98%
No473.81%

Developers also continue to adhere largely to the W3C DOM where possible, but the realities of different DOMs in different browsers mean most respondents take a pragmatic approach to this issue.

Do you strictly adhere to the W3C DOM, and avoid browser specific extensions?

2010
AnswerCount%
Yes45432.38%
As much as possible66447.36%
No815.78%
2008
AnswerCount%
Yes37530.39%
As much as possible61349.68%
No534.29%

Last year we were surprised at the extent to which respondents were using JavaScript and JavaScript libraries in their work.

While the percentage of respondents using them trails that using HTML5 markup, there’s still an impressive takeup of at least some aspects of HTML5 APIs, given how recent and still evolving these technologies are.

Next

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

-->