Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
329 views
in Technique[技术] by (71.8m points)

javascript - Are addListener and addEventListener the same? Can I use them interchangeably?

Started to learn Node.js, it seems like sometimes addListener is used and sometimes addEventListener, are they completely same? Can I use any at any time?

question from:https://stackoverflow.com/questions/65886959/are-addlistener-and-addeventlistener-the-same-can-i-use-them-interchangeably

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

No they aren't, and no, you can't.

What methods an API makes available will depend on the particular API.

I'm not aware of any that support addListener as an alias for addEventListener or vice versa.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...