I have a problem that drives me crazy and, in extreme cases, I ask a question here.
I want to move the onclick event from an element to an onfocus event of the same element, and I use the following code:
$("#theElement").bind("focus", {}, $("#theElement").data("events").click);
$("#theElement").unbind("click");
Perhaps you guessed it. THIS DOES NOT WORK.
How do I do this job? I get the message "fn.apply is not a function" in the following code snippet from jQuery 1.3.2:
proxy: function( fn, proxy ){
proxy = proxy || function(){ return fn.apply(this, arguments); };
proxy.guid = fn.guid = fn.guid || proxy.guid || this.guid++;
return proxy;
}
EDIT: Sorry, I should have mentioned. This comes from a plugin that does some things when you click an item. I want to do the same thing when an element receives focus not when it is clicked, so the simplest solution I thought was because I can’t change the code for the plugin.
: . , @sje397 ,
$('#theElement').data('events').click[0]
$('#theElement').data('events').click[3]
- , , 3 ( jquery).