Javascript Titbits
- Putting
()after a function/method causes it to run…without the parenthesis a reference to the function is passed around.) function functionName (parameterList){ statementList } is the same as window.functionName = function(parameterList) { statementList )- IE implements an incorrect version of
add()for select dropdowns-
var option = new Option(info[0], info[1]);is broken, rather you have to do:
selectList[0].add(option, null);
var option = document.createElement("option");
option.text = info[1];
option.value = info[0]
selectList[0].options.add(option);
Category: Web Development Comment »