Dynamic Function Reference in Javascript
January 10, 2007 7:54 AM
Subscribe
I'm writing a cross-browser JavaScript library that will allow me to apply events (onmouseover, click, etc) to elements using what look like stylesheets:
a {mouseover:someFunction;} In writing a parser for these files, I've come upon a stumbling block.
How does one reference a function given by a String? Or rather, in
element.onmouseover = someFunction
how would one let someFunction be a variable?
posted by potch to computers & internet (10 comments total)
4 users marked this as a favorite
posted by grouse at 8:01 AM on January 10, 2007