Unobtrusive JavaScript

from Wikipedia, the free encyclopedia

Unobtrusive JavaScript (literally. Unobtrusive JavaScript , also: barrier-free JavaScript ) is a specific principles undertook form as JavaScript in web pages is used. There is no uniform definition of the term and, in particular, it is not an official standard.

JavaScript should therefore not be a prerequisite for the functions of a website, but only expand the range of functions. The approaches of unobtrusive JavaScript play a role especially for barrier-free and mobile Internet .

Basic principles

  • Delimitation of content, behavior and presentation of websites ( Model View Controller )
  • Use best practices to avoid problems with traditional JavaScript programming
  • JavaScript as an extension of the functionality, not as a requirement

motivation

Historically, JavaScript had the reputation of being a clumsy, unpolished programming language that was useless for "serious" software development. This is mainly due to inconsistent implementations of the script environment and the DOM in different browsers, as well as the widespread use of copy & paste in program development. Runtime errors were so common and difficult to fix that many programmers foregone improvements as long as the script behaved more or less as desired. In some browsers, such a script could not be run at all.

The advent of standards-compliant browsers, JavaScript libraries, and better debugging tools made organized and scalable JavaScript code possible, and Ajax- based user interfaces even made it necessary.

Where JavaScript was previously only used for small, uncritical tasks, it is now the practice to also implement large, complicated projects that are often part of the core functionality of a website. Runtime errors are therefore not blemishes, but (under certain circumstances fatal) failures.

The concept of accessibility in the sense of JavaScript programming is shaped by the article Unobtrusive DHTML, and the power of unordered lists by Stuart Langridge. In this article, Langridge discusses the concept of strictly separating JavaScript from HTML . Since then he has presented this concept in detail in various articles and a book.

Web links

Individual evidence

  1. Jeremy Keith: Behavioral Separation . June 20, 2006. Retrieved March 6, 2011.
  2. ^ Tommy Olsson: Graceful Degradation & Progressive Enhancement . February 6, 2007. Retrieved March 6, 2011.
  3. ^ Stuart Langridge: Unobtrusive DHTML, and the power of unordered lists . November 2002. Retrieved August 7, 2008.
  4. ^ Building dynamic websites . August 9, 2006. Retrieved May 18, 2010.