prototype.js
具有以下功能
Event.observe(document, "dom:loaded", foo_function);
在执行document
之前等待foo_function
完成加载。如何将参数传递给foo_function
?
Event.observe(document, "dom:loaded", foo_function, {arg1: bar_argument, arg2: baz_argument})
答案 0 :(得分:3)
Event.observe(document, "dom:loaded", (function(e, bar_argument, baz_argument) {
//now bar_argument = bar,and baz_argument = baz
}).bindAsEventListener(this, bar, baz));