I'm trying to pass a function via a variable to be assigned as part of a click event, for instance:
function bindClick(func) {
$('#button').click(function() {
func();
return false;
});
}
function configureClick() {
bindClick(function () { executeClick(message); });
}
function executeClick(message) {
alert(message);
}
So configureClick() will run at some point, and then #button.click() needs to call the contents of func.
Whatever's happening, is doing so silently, no errors nor desired behavior.
UPDATE: I'm an idiot! The code above is working. My executeClick had a switch-case block which was being ignored as I was passing the incorrect key. Sorry for the trouble D:
"bananas!"?$(document).ready.alert('bananas!'), that's just a placeholder for "do other stuff"e.stopImmediatePropagation()or something that prevents the handler from executing.