11

If my memory serves me right, there was a time when using JavaScript for web development was hugely frowned upon, because among other things, it was a privacy and security concern for users and some people just had it off.

Nowadays, you can hardly see a major website that doesn't use JavaScript, and many websites will cease to function altogether without JS, graceful degradation be damned. Either that, or usability will be severely impacted, like on SE sites.

What has changed between then and now that made JavaScript practically ubiquitous in web development? Or is my assertion that JS was frowned upon a figment of my imagination and it has always been this way?

3 Answers 3

11

JavaScript has had both terribly bad and amazing features.

Earlier, when there was no Ajax, masses weren't aware of those amazing features. Web pages were just documents with some design elements (colors, images, textures, fonts, etc.) adorning them. The sense of dynamism and asynchronicity were unknown for the most part. IE 6 was dominant and Microsoft was way too busy selling other things.

...What has changed between then and now that made JavaScript practically ubiquitous...

  • The inception of Ajax has changed everything. Everybody wanted to make their pages ajaxy and THAT forced them to give a second (and serious) look at JavaScript.

  • People like Doug Crockford, John Resig, Steve Souders, and others (forgive me if I forget other important names) started spreading the word on the goodness of JavaScript.

  • About the same time, browser vendors started honing their browsers and making JavaScript performance better. JIT was introduced and that made the competition even more lethal. Microsoft woke up again.

  • ECMA got serious about JavaScript's future and started working hard on next versions -- which resulted in ECMAScript 5.

  • HTML5, DOM3, CSS3 all are contributing to JavaScript's increasing reign.

  • JavaScript has embarked to take on other domains also. Thanks to CommonJS.

3
  • Based on this: v8.googlecode.com/svn/data/benchmarks/v6/run.html, I would say that Microsoft still has yet to wake up...
    – riwalk
    Sep 30, 2011 at 15:16
  • @Stargazer712 My results Chrome 14 >> FF7 > Opera 11.5 > Safari 5.1 >>>> IE8. Though since the benchmark is from Google it's not surprising Chrome came out so far ahead. Sep 30, 2011 at 16:04
  • @NullUserException, true, but looking at the code, the benchmarks are reasonable.
    – riwalk
    Sep 30, 2011 at 16:34
4

Several changes came together to make thes brave new world:

  • Ajax Ok, lets be honest -- I mean Gmail. Gmail showed people that you could build a fluid web application in javascript. A flood of Ajax applications followed.

  • jQuery The browser's DOM APIs are horrible, and inconsistent to boot. jQuery gave people a decent API to code to that was consistent across browsers. (Yes, there are other good projects that do this to, but jQuery is the most popular.) It was also easy enough that non-programers could copy-paste their way to have smooth animation.

  • IE6 No, really! IE6 was the first browser to properly support something like the real CSS Spec, and the fact that IE was so dominant meant that you had a reliable baseline to build against. The fact that we laugh at it now has more to do with how old it is -- it was not bad when it first came out.

  • Chrome When Google came out with chrome, and its fast V8 engine, they started a new performance race, the outcome of which is significantly increased javascript speed across the web. Faster javascript means you can do more in javascript before it starts to annoy your users.

3

People invented remotely secure JavaScript sandboxes and learned to implement it more efficiently, along with a general increase in computing power making running it cheaper. Also, the advent of AJAX and stuff makes effects possible with JavaScript that you could never ever see possible with HTML alone- all of the most advanced web features simply require JavaScript. Thus, a website that runs without JavaScript is quite lifeless and inanimate, which is not what consumers want.

4
  • The "remotely secure JS sandboxes" puzzles me. Sure you can write safe JS, but what stopped people from writing malicious JS? Sep 30, 2011 at 13:38
  • @DeadMG Everyone seems to think that the only path to glory was HTML or nothing. This is the very real reason on why plugins (Flash being the most notable) grabbed market share. Standards are only as good as their competition. Sep 30, 2011 at 14:12
  • @NullUserException: It's much harder to write unsafe JS now. Most exploits involve tricking the remote server, such as XSS, not JS holes directly.
    – DeadMG
    Sep 30, 2011 at 14:30
  • +1 for mentioning sandboxes - it's not just "cool stuff" that drove the paradigm shift. Browser security and the Same Origin Policy had a lot to do with it. Browsers of that bygone era simply made surfing the web more dangerous (from a computer security standpoint).
    – Ryan Kinal
    Sep 30, 2011 at 21:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.