Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 8th, 2012  |  syntax: None  |  size: 0.38 KB  |  hits: 9  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How do I pass an argument to the handler of Event.observe?
  2. Event.observe(document, "dom:loaded", foo_function);
  3.        
  4. Event.observe(document, "dom:loaded", foo_function, {arg1: bar_argument, arg2: baz_argument})
  5.        
  6. Event.observe(document, "dom:loaded", (function(e, bar_argument, baz_argument) {
  7.     //now bar_argument = bar,and baz_argument = baz
  8. }).bindAsEventListener(this, bar, baz));