The Mozilla Developer Network (MDN) is a community driven web site containing a lot of various useful information regarding web development.
Objectdata type, even functions and arrays. Because of that, arrays are often misused in situations where plain objects would have been more appropriate and this leads to unexpected, but explainable behaviour.
thisis a special variable available in all functions. The value of
thisis not specified during definition time, but during runtime. How its value is determined is thoroughly decribed in the MDN documentation.
Here are some examples from Stack Overflow which uses the specification to explain certain behaviour:
- Why does
('0' ? 'a' : 'b')behave different than
('0' == true ? 'a' : 'b')
- Why does
'\n\t\r' == 0is
- What is the difference between
if (x == null)?
DOM (Document Object Model)
In contrast to the previous ways, advanced event handlers allow the registration of multiple, independent event handlers for the same event and element. Unfortunately this is also the approach with the biggest browser differences. The W3C-standard method
addEventListenerdoes not exist in IE8 and below.
When creating cross-browser compatible code, knowing about the differences is vital. quirksmode.org provides tables with information about which methods and properties are supported by which browsers (http://www.quirksmode.org/dom/events/index.html, http://www.quirksmode.org/dom/w3c_core.html, http://www.quirksmode.org/dom/w3c_html.html).
Working with the plain DOM API can be daunting. There are several libraries such as jQuery or Prototype.js which provide convenient wrappers around the DOM API and more. Still, to get most out of these libraries, you should understand the DOM.
CSS (Cascading Style Sheets)
HTML only describes the structure of a document, CSS defines how a document should look like.
For more information about CSS, have a look at the MDN documentation.