Talk:DOM events

From Wikipedia, the free encyclopedia
Jump to: navigation, search
WikiProject Computing  
WikiProject icon This article is within the scope of WikiProject Computing, a collaborative effort to improve the coverage of computers, computing, and information technology on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
 ???  This article has not yet received a rating on the project's quality scale.
 ???  This article has not yet received a rating on the project's importance scale.

While the inline model is not as flexible as other models, it is the only model that allow the registration of event handlers with custom arguments, e.g. name in the helloWorld method.

Not quite. Instead the browser creates an anonymous function that handles the event and that function calls the function with the argument specified. Eric B. and Rakim 22:12, 29 Apr 2005 (UTC)


According to google (and a bunch of others search engines) the ondomfocusout attribute is metioned in any other place but here. What's the source for this information?

I have no idea when you wrote this (and I'm too lazy to check), but try this DOMFocusOut --Execvator 23:56, 7 May 2007 (UTC)


Say what DOM stands for! What is * in "DOM*"?

DOM stands for Document Object Model. What is in it is the elements, methods, and properties of the document. (Bjorn Tipling 18:04, 30 March 2006 (UTC))
"DOM*" refers to every event whose name begins with "DOM". The star is being used as a wildcard character. (I've made this clearer in the article.) -- 15:02, 21 April 2006 (UTC)

(un)load event description[edit]

The description for the load an unload event was 'wrong'. They apply to both the document and elements. As it was, it sounded like they only applied to the document. I made some changes to reflect this, though it would be good if someone could rewrite it in a better way. And yes, it is 'and' for load and 'or' for unload[1]. --Execvator 23:56, 7 May 2007 (UTC)

Copyright Violation[edit]

I see no real explanation given for marking this page a copyright violation. While I'm not directly contesting the allegation, a link to the quirksmode website doesn't tell me anything. There isn't even any major plagiarism that I can see; even if there were, this doesn't necessarily infringe on copyright.

The only copyright notice posted by PPK on his site refers to copying an entire page (or the entire site), which certainly hasn't happened here. Lucideer (talk)

By default anything on that site is copyrighted. He disclaims copyright for his code, but that's not the issue here. It's explanations about the DOM that were being copied here. One of the most blatant aspects of the infringement is the "important drawbacks" part, which is copying not just facts, but his editorial opinions.
The solution here is to revert the newest version of the page before infringement was added. This requires some checking. Superm401 - Talk 11:23, 16 November 2008 (UTC)
Firstly, thanks for the explanation. I've not been on Wikipedia long, so I'm certainly no authority on policy, but I thought it was a little bizarre to completely obscure a page without comprehensive justification being written somewhere. If the issue is to be resolved, it's handy to now what that specific issue actually is.
Secondly, only one of the three listed "drawbacks" are taken from PPK's site (number 3 about the this keyword). I'd hardly call that blatant. Nor do I see it as his unique opinion, as a reference to window is, as he says, "completely useless". This surely constitutes logical fact purely based on the absence of a use for the reference.
The only issue I might have is that the first two aren't necessarily drawbacks (even if it is general consensus that they are), and calling them that violates Wikipedia:NPV. But changing the word drawbacks to something like inconsistencies would rectify this.
lucideer 22:58, 16 November 2008 (UTC)
What I don't think you realize is that this started as a blatant copyright infringement (look at [2]), and just became a little more subtle over time. A derivative work of a copyright infringement is still a copyright infringement. I had to go back to before the violation, which in this case, means February 16, 2005.
I detected no violations before that, though I can't rule it out because the person that added the violation also started the rest of the page too. It's very unfortunate no one caught this sooner. Superm401 - Talk 01:58, 17 November 2008 (UTC)
I'm sorry, I must be missing something. I see 4 lines of text, which state simple fact, in plain english, that were taken from the referenced ppk page. Two years ago.
When compared to the W3C model, the Microsoft model has two important drawbacks:
Events always bubble, no capturing possibility.
The event handling function is referenced, not copied, so the this keyword always refers to the window and is completely useless.
  1. These 4 tiny lines have since been modified, so their current incarnation should not infringe.
  2. "A derivative work of a copyright infringement is still a copyright infringement." - a derivitave work is a creative derivation, of a creative work. These lines state fact. They are purely informational, and completely unoriginal, both here and on ppk's site. As you said above, he has copyrighted his code - something creative in nature.
I've mentioned before that I'm a new Wikipedia user, and tbh I feel a little intimidated even having this debate. But to be perfectly frank, I find it shocking that a user with your experience and and level of contribution to the community truly believes the best solution here is to revert an article on an extremely dynamic, fast-moving topic to a version that is two and a half years out of date! - lucideer 06:59, 17 November 2008 (UTC)
Actually, after reading over what I wrote above, and thinking about it, I'm fairly sure there should be no copyvio issue here whatsoever as per Wikipedia:Public_domain#Non-creative_works. - lucideer 07:11, 17 November 2008 (UTC)
It doesn't matter that the violation has since been modified. It still had to be removed. Text that was not a copyright violation can now be added back. You are incorrect that this can be considered a non-creative work. Judging something as an advantage or disadvantage is inherently opinionated, not factual. Superm401 - Talk 09:26, 18 November 2008 (UTC)
I have added back the text other than the part you flagged as copyvio as you said. What I've then done is taken the points from the DOM2 section and copied and pasted them directly into the Microsoft section. I then reworded accordingly.
I also added a line referring to the this keyword, as I feel omitting this would deeply confuse many readers of the article (it would confuse me). I have made every attempt to make that line comply with NPOV, keeping it as short and simple as possible. It is my view that calling it a drawback is a statement of fact, not opinion. However as you disagree, I have not commented in any way on the this keyword, as per your preference.

Browser Comparison for DOM Events?[edit]

Shouldn't there be a browser comparison of DOM events somewhere - like there are with HTML5 support, etc. It could be helpful since some browser support some events and some do not. Case in point Firefox recently added support for the readystatechange event - on this page it is listed as a "Microsoft-specific event" even though it is no longer exclusive to Micrsoft.

Does anyone else agree or disagree with this?

Ryan Jones (talk) 16:12, 26 June 2010 (UTC)

load fires more often?[edit]

I observed in a Firefox extension that gBrowser.AddEventListener("load", ...) fires more often than expected: When moving from one page to another, it appears that the listener is first called with the page being left and then (or maybe intertwined) with the new page. IMHO that does not match the description here.--Hagman-de (talk) 09:44, 13 August 2010 (UTC)

Wrong, misleading, irrelevant, outdated and incomplete[edit]

"DOM (Document Object Model) events allow event-driven programming languages like [...]"
This is wrong. The DOM Events are language agnostic. The mechanism is part of the DOM and not the language. I.e. a DOM implementation's nodes implement the EventTarget interface.

"Events are first captured until it reaches the target element, and then bubbled up"
This is wrong. This implies that the event target's capturing phase listeners would be called before the bubbling phase listeners, which is not the case. There is a third phase: AT_TARGET.

"To prevent an event from bubbling, developers must call the 'stopPropagation()' method of the event object."
This is wrong. In fact it does what its name suggests: it stops propagation of an event. In any phase.

"To add parameters: [...]"
This is wrong. The function already closes over "name". What you suggest is needed only when "name"'s current value need to be preserved, which is irrelevant to the example, not specific to the event model, and thus misleading.

"Inner functions preserve their scope."
This is wrong. Functions close over the scope they are defined in. Also the 'outer' function. See above paragraph.

"Touch events"
Why are the TouchEvent, TouchList and TouchPoint interface definitions given, and not e.g. more fundamental interfaceslike Event, UIEvent, MouseEvent? And are such interface definitions relevant? And if so, do we need the interface definition and a description of it, or could this be more concise? Why not just point to the spec(s)?

Much of the rest is outdated or incomplete. e.g. DOM L3 Event interface provides stopImmediatePropagation() method, and HTML5 dnd spec is not mentioned at all.

Maybe I should write an article about horses, because I have read a blog about them, and I have even touched one! It'll start with "Horses are brown and they need horseshoes to walk". (talk) 11:53, 19 June 2011 (UTC)

Type versus Attribute distinction?[edit]

The tables in this article distinguish between "type" and "attribute" (e.g. keypress versus onkeypress). What is meant with these two columns, and what are their differences? --Abdull (talk) 15:02, 28 April 2012 (UTC)

Mutation observers[edit]

Should DOM4 mutation observers be described in this article, or in another? It quacks like a duck, but W3C doesn't group it with the other ducks.

Event Flow[edit]

Please clarify the Event Flow section, or at least within the section give deep (specify sections within large documents) citations to specific documents which would clarify.

By my naive reading, the current language says that in Netscape, events are either acted on or ignored sequentially in time first by outermost elements then (if unacted on?) by the next outermost element, until the deepest element, and this process is named "capture". In all other major browsers, the events are acted on or ignored sequentially in time first by the innermost elements, then (if unacted on?) by the next innermost element until it reaches the outermost element, and this process is named "bubble". Then the wording suggest that the W3C specifies that the event is either acted on or ignored first by the outermost element down to the innermost (captured) but then also acted on or ignored by the next innermost element (bubbled), meaning that all but the innermost element would have an opportunity to act on the event twice -- but that strains credulity. Again, please either clarify or provide citations to clarifying documents.

If "Netscape" also means "Mozilla", that would be good to know. If the W3C "position" represents a significant departure from common browser behavior, it would be good to know which browsers, if any, have adopted their "position".

Thyrsus (talk) 16:49, 28 August 2012 (UTC)

And yet there it is. ("Strains credulity"? Really?) It is now 2012. Netscape is officially five years in the grave, the code that it donated to Mozilla was replaced with Gecko fifteen years ago, W3C is a standards organization that codifies consensus on browser behavior and as such does not have "position" independent of vendors.
The section is of course awful. The "struggle" dates to the browser wars; browsers today implement the W3C event model, and have done so for a decade. Yappy2bhere (talk) 22:11, 15 September 2012 (UTC)
Thanks! Your changes help a lot. Thyrsus (talk) 23:05, 20 September 2012 (UTC)

External links modified[edit]

Hello fellow Wikipedians,

I have just added archive links to one external link on DOM events. Please take a moment to review my edit. If necessary, add {{cbignore}} after the link to keep me from modifying it. Alternatively, you can add {{nobots|deny=InternetArchiveBot}} to keep me off the page altogether. I made the following changes:

When you have finished reviewing my changes, please set the checked parameter below to true to let others know.

You may set the |checked=, on this template, to true or failed to let other editors know you reviewed the change. If you find any errors, please use the tools below to fix them or call an editor by setting |needhelp= to your help request.

  • If you have discovered URLs which were erroneously considered dead by the bot, you can report them with this tool.
  • If you found an error with any archives or the URLs themselves, you can fix them with this tool.

If you are unable to use these tools, you may set |needhelp=<your help request> on this template to request help from an experienced user. Please include details about your problem, to help other editors.

Cheers.—cyberbot IITalk to my owner:Online 09:28, 10 January 2016 (UTC)