为了账号安全,请及时绑定邮箱和手机立即绑定

函数名 和 "函数名()"

什么时候直接用函数名调用函数,什么时候要用"函数名()"?

正在回答

3 回答

https://www.imdb.com/list/ls501878361/ https://www.imdb.com/list/ls501878361/?mode=desktop https://www.imdb.com/list/ls501878324/ https://www.imdb.com/list/ls501878324/?mode=desktop https://www.imdb.com/list/ls501878390/ https://www.imdb.com/list/ls501878390/?mode=desktop https://www.imdb.com/list/ls501878605/ https://www.imdb.com/list/ls501878605/?mode=desktop https://www.imdb.com/list/ls501878657/ https://www.imdb.com/list/ls501878657/?mode=desktop https://www.imdb.com/list/ls501878674/ https://www.imdb.com/list/ls501878674/?mode=desktop https://www.imdb.com/list/ls501878633/ https://www.imdb.com/list/ls501878633/?mode=desktop https://www.imdb.com/list/ls501878668/ https://www.imdb.com/list/ls501878668/?mode=desktop https://www.imdb.com/list/ls501878641/ https://www.imdb.com/list/ls501878641/?mode=desktop https://www.imdb.com/list/ls501878698/ https://www.imdb.com/list/ls501878698/?mode=desktop https://www.imdb.com/list/ls501878206/ https://www.imdb.com/list/ls501878206/?mode=desktop https://www.imdb.com/list/ls501878252/ https://www.imdb.com/list/ls501878252/?mode=desktop https://www.imdb.com/list/ls501878216/ https://www.imdb.com/list/ls501878216/?mode=desktop https://www.imdb.com/list/ls501878236/ https://www.imdb.com/list/ls501878236/?mode=desktop https://www.imdb.com/list/ls501878268/ https://www.imdb.com/list/ls501878268/?mode=desktop https://www.imdb.com/list/ls501878249/ https://www.imdb.com/list/ls501878249/?mode=desktop https://www.imdb.com/list/ls501878285/ https://www.imdb.com/list/ls501878285/?mode=desktop https://www.imdb.com/list/ls501878407/ https://www.imdb.com/list/ls501878407/?mode=desktop https://www.imdb.com/list/ls501878454/ https://www.imdb.com/list/ls501878454/?mode=desktop https://www.imdb.com/list/ls501878411/ https://www.imdb.com/list/ls501878411/?mode=desktop https://www.imdb.com/list/ls501878433/ https://www.imdb.com/list/ls501878433/?mode=desktop https://www.imdb.com/list/ls501878424/ https://www.imdb.com/list/ls501878424/?mode=desktop https://www.imdb.com/list/ls501878490/ https://www.imdb.com/list/ls501878490/?mode=desktop https://www.imdb.com/list/ls501878482/ https://www.imdb.com/list/ls501878482/?mode=desktop https://www.imdb.com/list/ls501878950/ https://www.imdb.com/list/ls501878950/?mode=desktop https://www.imdb.com/list/ls501878975/ https://www.imdb.com/list/ls501878975/?mode=desktop https://www.imdb.com/list/ls501878916/ https://www.imdb.com/list/ls501878916/?mode=desktop https://www.imdb.com/list/ls501810127/ https://www.imdb.com/list/ls501810127/?mode=desktop https://www.imdb.com/list/ls501810187/ https://www.imdb.com/list/ls501810187/?mode=desktop https://www.imdb.com/list/ls501810350/ https://www.imdb.com/list/ls501810350/?mode=desktop https://www.imdb.com/list/ls501810372/ https://www.imdb.com/list/ls501810372/?mode=desktop https://www.imdb.com/list/ls501810312/ https://www.imdb.com/list/ls501810312/?mode=desktop https://www.imdb.com/list/ls501810332/ https://www.imdb.com/list/ls501810332/?mode=desktop https://www.imdb.com/list/ls501810325/ https://www.imdb.com/list/ls501810325/?mode=desktop https://www.imdb.com/list/ls501810397/ https://www.imdb.com/list/ls501810397/?mode=desktop https://www.imdb.com/list/ls501810387/ https://www.imdb.com/list/ls501810387/?mode=desktop https://www.imdb.com/list/ls501810609/ https://www.imdb.com/list/ls501810609/?mode=desktop https://www.imdb.com/list/ls501810675/ https://www.imdb.com/list/ls501810675/?mode=desktop https://www.imdb.com/list/ls501810611/ https://www.imdb.com/list/ls501810611/?mode=desktop https://www.imdb.com/list/ls501810638/ https://www.imdb.com/list/ls501810638/?mode=desktop https://www.imdb.com/list/ls501810625/ https://www.imdb.com/list/ls501810625/?mode=desktop https://www.imdb.com/list/ls501810646/ https://www.imdb.com/list/ls501810646/?mode=desktop https://www.imdb.com/list/ls501810692/ https://www.imdb.com/list/ls501810692/?mode=desktop https://www.imdb.com/list/ls501810689/ https://www.imdb.com/list/ls501810689/?mode=desktop https://www.imdb.com/list/ls501810257/ https://www.imdb.com/list/ls501810257/?mode=desktop https://www.imdb.com/list/ls501810215/ https://www.imdb.com/list/ls501810215/?mode=desktop https://www.imdb.com/list/ls501810238/ https://www.imdb.com/list/ls501810238/?mode=desktop https://www.imdb.com/list/ls501810228/ https://www.imdb.com/list/ls501810228/?mode=desktop https://www.imdb.com/list/ls501810299/ https://www.imdb.com/list/ls501810299/?mode=desktop https://www.imdb.com/list/ls501810404/ https://www.imdb.com/list/ls501810404/?mode=desktop https://www.imdb.com/list/ls501810478/ https://www.imdb.com/list/ls501810478/?mode=desktop https://www.imdb.com/list/ls501810432/ https://www.imdb.com/list/ls501810432/?mode=desktop https://www.imdb.com/list/ls501810468/ https://www.imdb.com/list/ls501810468/?mode=desktop https://www.imdb.com/list/ls501810441/ https://www.imdb.com/list/ls501810441/?mode=desktop https://www.imdb.com/list/ls501810494/ https://www.imdb.com/list/ls501810494/?mode=desktop https://www.imdb.com/list/ls501810902/ https://www.imdb.com/list/ls501810902/?mode=desktop https://www.imdb.com/list/ls501810953/ https://www.imdb.com/list/ls501810953/?mode=desktop https://www.imdb.com/list/ls501810917/ https://www.imdb.com/list/ls501810917/?mode=desktop https://www.imdb.com/list/ls501810932/ https://www.imdb.com/list/ls501810932/?mode=desktop https://www.imdb.com/list/ls501810968/ https://www.imdb.com/list/ls501810968/?mode=desktop https://www.imdb.com/list/ls501810944/ https://www.imdb.com/list/ls501810944/?mode=desktop https://www.imdb.com/list/ls501810999/ https://www.imdb.com/list/ls501810999/?mode=desktop https://www.imdb.com/list/ls501810808/ https://www.imdb.com/list/ls501810808/?mode=desktop https://www.imdb.com/list/ls501815035/ https://www.imdb.com/list/ls501815035/?mode=desktop https://www.imdb.com/list/ls501815066/ https://www.imdb.com/list/ls501815066/?mode=desktop https://www.imdb.com/list/ls501815045/ https://www.imdb.com/list/ls501815045/?mode=desktop https://www.imdb.com/list/ls501815087/ https://www.imdb.com/list/ls501815087/?mode=desktop https://www.imdb.com/list/ls501815509/ https://www.imdb.com/list/ls501815509/?mode=desktop https://www.imdb.com/list/ls501815570/ https://www.imdb.com/list/ls501815570/?mode=desktop https://www.imdb.com/list/ls501815518/ https://www.imdb.com/list/ls501815518/?mode=desktop https://www.imdb.com/list/ls501815565/ https://www.imdb.com/list/ls501815565/?mode=desktop https://www.imdb.com/list/ls501815779/ https://www.imdb.com/list/ls501815779/?mode=desktop https://www.imdb.com/list/ls501815736/ https://www.imdb.com/list/ls501815736/?mode=desktop https://www.imdb.com/list/ls501815762/ https://www.imdb.com/list/ls501815762/?mode=desktop https://www.imdb.com/list/ls501815723/ https://www.imdb.com/list/ls501815723/?mode=desktop https://www.imdb.com/list/ls501815746/ https://www.imdb.com/list/ls501815746/?mode=desktop https://www.imdb.com/list/ls501815797/ https://www.imdb.com/list/ls501815797/?mode=desktop https://www.imdb.com/list/ls501815101/ https://www.imdb.com/list/ls501815101/?mode=desktop https://www.imdb.com/list/ls501815171/ https://www.imdb.com/list/ls501815171/?mode=desktop https://www.imdb.com/list/ls501815116/ https://www.imdb.com/list/ls501815116/?mode=desktop https://www.imdb.com/list/ls501815130/ https://www.imdb.com/list/ls501815130/?mode=desktop https://www.imdb.com/list/ls501815169/ https://www.imdb.com/list/ls501815169/?mode=desktop https://www.imdb.com/list/ls501815149/ https://www.imdb.com/list/ls501815149/?mode=desktop https://www.imdb.com/list/ls501815196/ https://www.imdb.com/list/ls501815196/?mode=desktop https://www.imdb.com/list/ls501815188/ https://www.imdb.com/list/ls501815188/?mode=desktop https://www.imdb.com/list/ls501815306/ https://www.imdb.com/list/ls501815306/?mode=desktop https://www.imdb.com/list/ls501815317/ https://www.imdb.com/list/ls501815317/?mode=desktop https://www.imdb.com/list/ls501815330/ https://www.imdb.com/list/ls501815330/?mode=desktop https://www.imdb.com/list/ls501815331/ https://www.imdb.com/list/ls501815331/?mode=desktop https://www.imdb.com/list/ls501815363/ https://www.imdb.com/list/ls501815363/?mode=desktop https://www.imdb.com/list/ls501815321/ https://www.imdb.com/list/ls501815321/?mode=desktop https://www.imdb.com/list/ls501815324/ https://www.imdb.com/list/ls501815324/?mode=desktop https://www.imdb.com/list/ls501815692/ https://www.imdb.com/list/ls501815692/?mode=desktop https://www.imdb.com/list/ls501815686/ https://www.imdb.com/list/ls501815686/?mode=desktop https://www.imdb.com/list/ls501815202/ https://www.imdb.com/list/ls501815202/?mode=desktop https://www.imdb.com/list/ls501815258/ https://www.imdb.com/list/ls501815258/?mode=desktop https://www.imdb.com/list/ls501815213/ https://www.imdb.com/list/ls501815213/?mode=desktop https://www.imdb.com/list/ls501815233/ https://www.imdb.com/list/ls501815233/?mode=desktop https://www.imdb.com/list/ls501815221/ https://www.imdb.com/list/ls501815221/?mode=desktop https://www.imdb.com/list/ls501815240/ https://www.imdb.com/list/ls501815240/?mode=desktop https://www.imdb.com/list/ls501815297/ https://www.imdb.com/list/ls501815297/?mode=desktop https://www.imdb.com/list/ls501815288/ https://www.imdb.com/list/ls501815288/?mode=desktop https://www.imdb.com/list/ls501815407/ https://www.imdb.com/list/ls501815407/?mode=desktop https://www.imdb.com/list/ls501815466/ https://www.imdb.com/list/ls501815466/?mode=desktop https://www.imdb.com/list/ls501815489/ https://www.imdb.com/list/ls501815489/?mode=desktop https://www.imdb.com/list/ls501815974/ https://www.imdb.com/list/ls501815974/?mode=desktop https://www.imdb.com/list/ls501815915/ https://www.imdb.com/list/ls501815915/?mode=desktop https://www.imdb.com/list/ls501815968/ https://www.imdb.com/list/ls501815968/?mode=desktop https://www.imdb.com/list/ls501815943/ https://www.imdb.com/list/ls501815943/?mode=desktop https://www.imdb.com/list/ls501815996/ https://www.imdb.com/list/ls501815996/?mode=desktop https://www.imdb.com/list/ls501815988/ https://www.imdb.com/list/ls501815988/?mode=desktop https://www.imdb.com/list/ls501815804/ https://www.imdb.com/list/ls501815804/?mode=desktop https://www.imdb.com/list/ls501815859/ https://www.imdb.com/list/ls501815859/?mode=desktop https://www.imdb.com/list/ls501815872/ https://www.imdb.com/list/ls501815872/?mode=desktop https://www.imdb.com/list/ls501815818/ https://www.imdb.com/list/ls501815818/?mode=desktop https://www.imdb.com/list/ls501815860/ https://www.imdb.com/list/ls501815860/?mode=desktop https://www.imdb.com/list/ls501815868/ https://www.imdb.com/list/ls501815868/?mode=desktop https://www.imdb.com/list/ls501815845/ https://www.imdb.com/list/ls501815845/?mode=desktop https://www.imdb.com/list/ls501815842/ https://www.imdb.com/list/ls501815842/?mode=desktop https://www.imdb.com/list/ls501815892/ https://www.imdb.com/list/ls501815892/?mode=desktop https://www.imdb.com/list/ls501815889/ https://www.imdb.com/list/ls501815889/?mode=desktop https://www.imdb.com/list/ls501817068/ https://www.imdb.com/list/ls501817068/?mode=desktop https://www.imdb.com/list/ls501817029/ https://www.imdb.com/list/ls501817029/?mode=desktop https://www.imdb.com/list/ls501817091/ https://www.imdb.com/list/ls501817091/?mode=desktop https://www.imdb.com/list/ls501817085/ https://www.imdb.com/list/ls501817085/?mode=desktop https://www.imdb.com/list/ls501817503/ https://www.imdb.com/list/ls501817503/?mode=desktop https://www.imdb.com/list/ls501817550/ https://www.imdb.com/list/ls501817550/?mode=desktop https://www.imdb.com/list/ls501817554/ https://www.imdb.com/list/ls501817554/?mode=desktop https://www.imdb.com/list/ls501817576/ https://www.imdb.com/list/ls501817576/?mode=desktop https://www.imdb.com/list/ls501817511/ https://www.imdb.com/list/ls501817511/?mode=desktop https://www.imdb.com/list/ls501817533/ https://www.imdb.com/list/ls501817533/?mode=desktop https://www.imdb.com/list/ls501817538/ https://www.imdb.com/list/ls501817538/?mode=desktop https://www.imdb.com/list/ls501817520/ https://www.imdb.com/list/ls501817520/?mode=desktop https://www.imdb.com/list/ls501817543/ https://www.imdb.com/list/ls501817543/?mode=desktop https://www.imdb.com/list/ls501817595/ https://www.imdb.com/list/ls501817595/?mode=desktop https://www.imdb.com/list/ls501817582/ https://www.imdb.com/list/ls501817582/?mode=desktop https://www.imdb.com/list/ls501817704/ https://www.imdb.com/list/ls501817704/?mode=desktop https://www.imdb.com/list/ls501817752/ https://www.imdb.com/list/ls501817752/?mode=desktop https://www.imdb.com/list/ls501817772/ https://www.imdb.com/list/ls501817772/?mode=desktop https://www.imdb.com/list/ls501817716/ https://www.imdb.com/list/ls501817716/?mode=desktop https://www.imdb.com/list/ls501817731/ https://www.imdb.com/list/ls501817731/?mode=desktop https://www.imdb.com/list/ls501817766/ https://www.imdb.com/list/ls501817766/?mode=desktop https://www.imdb.com/list/ls501817721/ https://www.imdb.com/list/ls501817721/?mode=desktop https://www.imdb.com/list/ls501817742/ https://www.imdb.com/list/ls501817742/?mode=desktop https://www.imdb.com/list/ls501817792/ https://www.imdb.com/list/ls501817792/?mode=desktop https://www.imdb.com/list/ls501817789/ https://www.imdb.com/list/ls501817789/?mode=desktop https://www.imdb.com/list/ls501817158/ https://www.imdb.com/list/ls501817158/?mode=desktop https://www.imdb.com/list/ls501817119/ https://www.imdb.com/list/ls501817119/?mode=desktop https://www.imdb.com/list/ls501817163/ https://www.imdb.com/list/ls501817163/?mode=desktop https://www.imdb.com/list/ls501817122/ https://www.imdb.com/list/ls501817122/?mode=desktop https://www.imdb.com/list/ls501817197/ https://www.imdb.com/list/ls501817197/?mode=desktop https://www.imdb.com/list/ls501817183/ https://www.imdb.com/list/ls501817183/?mode=desktop https://www.imdb.com/list/ls501817308/ https://www.imdb.com/list/ls501817308/?mode=desktop https://www.imdb.com/list/ls501817370/ https://www.imdb.com/list/ls501817370/?mode=desktop https://www.imdb.com/list/ls501817313/ https://www.imdb.com/list/ls501817313/?mode=desktop https://www.imdb.com/list/ls501817360/ https://www.imdb.com/list/ls501817360/?mode=desktop https://www.imdb.com/list/ls501817325/ https://www.imdb.com/list/ls501817325/?mode=desktop https://www.imdb.com/list/ls501817342/ https://www.imdb.com/list/ls501817342/?mode=desktop https://www.imdb.com/list/ls501817396/ https://www.imdb.com/list/ls501817396/?mode=desktop https://www.imdb.com/list/ls501817601/ https://www.imdb.com/list/ls501817601/?mode=desktop https://www.imdb.com/list/ls501817654/ https://www.imdb.com/list/ls501817654/?mode=desktop https://www.imdb.com/list/ls501817617/ https://www.imdb.com/list/ls501817617/?mode=desktop https://www.imdb.com/list/ls501817631/ https://www.imdb.com/list/ls501817631/?mode=desktop https://www.imdb.com/list/ls501817663/ https://www.imdb.com/list/ls501817663/?mode=desktop https://www.imdb.com/list/ls501817640/ https://www.imdb.com/list/ls501817640/?mode=desktop https://www.imdb.com/list/ls501817695/ https://www.imdb.com/list/ls501817695/?mode=desktop https://www.imdb.com/list/ls501817689/ https://www.imdb.com/list/ls501817689/?mode=desktop https://www.imdb.com/list/ls501817253/ https://www.imdb.com/list/ls501817253/?mode=desktop https://www.imdb.com/list/ls501817276/ https://www.imdb.com/list/ls501817276/?mode=desktop https://www.imdb.com/list/ls501817267/ https://www.imdb.com/list/ls501817267/?mode=desktop https://www.imdb.com/list/ls501817245/ https://www.imdb.com/list/ls501817245/?mode=desktop https://www.imdb.com/list/ls501817248/ https://www.imdb.com/list/ls501817248/?mode=desktop https://www.imdb.com/list/ls501817280/ https://www.imdb.com/list/ls501817280/?mode=desktop https://www.imdb.com/list/ls501817405/ https://www.imdb.com/list/ls501817405/?mode=desktop https://www.imdb.com/list/ls501817450/ https://www.imdb.com/list/ls501817450/?mode=desktop

0 回复 有任何疑惑可以回复我~

以我的理解,给你举个例子,参考参考:

function ab(){
    return c;
}
var me = ab(); //  (1)
var me = ab;   //  (2)

(1)是调用;(2)是赋值。

【(1)中,等价于 var me = c。那么这是赋值还是调用?不要被误导,这是调用。先调用了函数ab,调用完返回了c,赋值给变量me。】

那么在什么情况下是赋值?

比如 btn.onclick = ab;这种情况,就是把函数给系统,让系统去调用。为什么不是btn.onclick = ab(); 如果是这样,文件加载到这一行,他就会直接执行,执行完,如果有返回值,就会给btn.onclick返回值,如举例中返回的是c。如果没有返回值,则返回null,这样相当于btn.onclick = null。

2 回复 有任何疑惑可以回复我~

后者才是函数的调用吧,函数名只是代表了一个函数,单独写出来并不能执行,函数名()才可以执行函数,自己的一点理解,不知道能不能帮到你

0 回复 有任何疑惑可以回复我~
#1

wengyaqiang 提问者

谢谢你的热心,我忘记了当时提问的背景,问题没描述清楚,是指比如本节课中的, window.onload=drag; oTitle.onmousedown=fnDown; 你看这里调用函数都没有加(),就是不太理解()的意义,是否可以写为 window.onload="drag()" 还是说widow.onload=drag()?
2015-07-26 回复 有任何疑惑可以回复我~
#2

zoe0773 回复 wengyaqiang 提问者

这里的 drag 和 fnDown 其实就是一个分别指向这两个不同函数的指针。 drag 指向 function drag(){}这个函数体,同样 fnDown 也是
2015-10-24 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

函数名 和 "函数名()"

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信