Given the code below, how can you get unbind('click', h) to work?
It doesn’t currently work. I could make h a global variable but I don’t know how to “set this up” given the msg variable is set within the function.
??
function x(open) {
var msg = "blah";
var h = function (e) {
e.preventDefault();
showDialog(msg);
};
if (open === true) {
but.unbind('click');
link.unbind('click');
} else {
but.click(h);
link.click(h);
}
}
*I Think