JavaScript

Well, JavaScript is Turing-complete, so we’re safe using it for any browser-related issue we may face, aren’t we?

I would fairly disagree, as driven by powerful frameworks JavaScript is used also for implementations that are meantime within reach of CSS3 and HTML5. So I use JavaScript basically to

  • change styles on events not supported by CSS (e.g. “click”). Note that JavaScript representations of the CSS attributes differ from their native CSS names if they contain a hyphen as JavaScript always interprets it as a minus symbol (so you need a CSS to JavaScript style mapping legend) or apply the rule “remove the hyphen, then camel-case”
  • handle AJAX requests and responses
  • manage browser windows and links

But even such basic use is sometimes tricky. Just try to remove event listeners from a DOM element, that have been set by foreign code, or by a previous instance of your own code. Without juggling DOM nodes, still today, it’s impossible. So it’s not the language itself, but the BOM/DOM APIs it uses. See JS/ DOM events for some details.

Comments are closed.