May 2007 Entries

Dynamic Events in Javascript

WITHOUT PARAMETERS
Element.<<EVENT>> = <<FUNCTION-NAME>>
eg: document.onLoad = showShadow;

WITH PARAMETERS
Element.<<EVENT>> = function(){ <<FUNCTIONNAME>>(<<PARAM LIST>>)};
eg:  element.onClick = function(){ showAlert(param1,param2) }; // This is a reference to a function