Is IE rendering in quirks mode?

11/09/2009

To find out, load the page in question and then paste this into your address bar:

javascript:alert(document.compatMode);

‘backCompat’ is quirks mode; ‘css1Compat’ is standards mode.

More info on quirks mode: http://www.quirksmode.org/css/quirksmode.html

No Comments

Javascript: removing all child nodes from an element

22/08/2006
while(select_box.firstChild) {
  select_box.removeChild(select_box.firstChild);
}

In this case, select_box is a select element, which was retrieved using:

select_box = document.getElementById('some_select_box_or_other');

Example borrowed from http://developer.mozilla.org/en/docs/DOM:element.childNodes

No Comments