Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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?

share|improve this question
add comment

3 Answers

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.

share|improve this answer
    
The "remotely secure JS sandboxes" puzzles me. Sure you can write safe JS, but what stopped people from writing malicious JS? –  NullUserException Sep 30 '11 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. –  Aaron McIver Sep 30 '11 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 '11 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 '11 at 21:58
add comment

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.

share|improve this answer
    
Based on this: v8.googlecode.com/svn/data/benchmarks/v6/run.html, I would say that Microsoft still has yet to wake up... –  Stargazer712 Sep 30 '11 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. –  NullUserException Sep 30 '11 at 16:04
    
@NullUserException, true, but looking at the code, the benchmarks are reasonable. –  Stargazer712 Sep 30 '11 at 16:34
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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