jquery - manually call a function in javascript? - Stack Overflow

How do you do this? like PHP has call_user_funcI'm trying to pass a callback function to jQuery.an

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
Add a ment  | 

1 Answer 1

Reset to default 7

You 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

相关推荐

  • jquery - manually call a function in javascript? - Stack Overflow

    How do you do this? like PHP has call_user_funcI'm trying to pass a callback function to jQuery.an

    3小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信