I'm trying to write some jquery that will call a function when an object is blurred. Because of some of the requirement in my underlying code, I need to call a function, like this:
$("object").blur(myFunction());
instead of like this:
$("object").blur(function() {
//do stuff
});
Unfortunately, binding the blur event using the first method doesn't work. It actually runs the method on page load, and then never binds the function. What am I doing wrong here?
I've set up a jsfiddle that demonstrates my problem, if it helps you visualize. http://jsfiddle.net/WskKJ/
$("object").blur(myFunction);
dont use () when u pass a delegate
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With