How do you do this? like PHP has call_user_func
I'm trying to pass a callback function to jQuery.animate(), like this
...
plete: function(){
// do_something
call_function(my_callback); // here need to call my_callback
}
...
How do you do this? like PHP has call_user_func
I'm trying to pass a callback function to jQuery.animate(), like this
...
plete: function(){
// do_something
call_function(my_callback); // here need to call my_callback
}
...
Share
Improve this question
asked Jun 26, 2011 at 3:52
EdithEdith
31 silver badge2 bronze badges
1 Answer
Reset to default 7You can simply call it like you would any function
my_callback();
JavaScript also has a call method that some people prefer
my_callback.call();
Here's a link I found with some extra information regarding the call method. https://developer.mozilla/en/JavaScript/Reference/Global_Objects/Function/Call
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745348902a4623707.html
评论列表(0条)