3
When I use addEventListener
is the same as window.addEventListener
or there is a difference?
3
When I use addEventListener
is the same as window.addEventListener
or there is a difference?
6
None, they are the same thing. It is a method of window
made available in the global scope.
All methods/properties of window
are in the global scope and can be accessed via object: window.location.href
or directly location.href
. There are hundreds...
Where do you find this most technical javascript information?
@Moraisvilson you can do on the console console.log(Object.keys(window));
and you will see all properties/methods. For more technical documentation you can always use MDN: https://developer.mozilla.org/en-US/docs/Web/API/Window
Browser other questions tagged javascript
You are not signed in. Login or sign up in order to post.
As far as I know, it’s a matter of reference,
window
you are referring to the window itself. But I may be wrong.– Rafael Augusto
window takes the whole window, up to where you type the URL, Document you take the document only, the website.
– Lucas de Carvalho
You mean addeventlistener without the point refers to Document?
– Morais Vilson
Exactly, it’s the same user thing
document
– Rafael Augusto