Hello, I'm stuck on a silly detail. I want to bind a click to a function whose name is a simple string in a variable from a database
I've tried a number of different syntactical combinations but none seem to work. Here is my code: $( ".object" ).each( function() { var element = this; var click_func = $( "#"+element.id + " .dp_properties").attr("dp_click_func"); if ( typeof( click_func ) != "undefined" ) { $(element).bind( "click", click_func ); // This doesnt' work, it's a function name from a database } else { $(element).bind( "click", click_handler ); // This does work, it's a predefined function } }); The function name that I'm using in click_func is called lock and the function is predefined in my base javascript. I tried calling it by using window[click_func](), click_func+"()" and other assorted methods. No luck. I'm sure this is vary simple and I will slap my head when it gets figured out. Thanks, ml