何时在回调函数名称后使用()? [英] When to use () after a callback function name?
本文介绍了何时在回调函数名称后使用()?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这有什么区别?
$("a").on("click", anotherFunction);
和这个:
$("a").on("click", anotherFunction());
有没有办法使没有匿名功能的最后一个自我可执行文件?
And is there a way to not make the last one self executable without anonymous function?
推荐答案
第一个传递实际功能;第一个传递实际功能.第二个传递函数的返回值.
The first one passes the actual function; the second passes the returned value of the function.
我不清楚你最后一个问题的含义.
I'm unclear on the meaning of your final question.
这篇关于何时在回调函数名称后使用()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文