0

is it possible to launch an event before the node is inserted? I know that "domnodeinserted" works in gecko based browsers but I that code is executed after the node is inserted. I actually want to execute a code before the node is inserted. Thanks in advance!

000
  • 26,951
  • 10
  • 71
  • 101
Shaokan
  • 7,438
  • 15
  • 56
  • 80
  • 1
    I don't think there is but the real question is: why do you need this? The DOM is only a view model, any logic should be handled by your underlying JavaScript model. – Halcyon Apr 25 '11 at 14:47
  • I'm more-or-less in agreement with @Frits. There's really no need for a `domnodeinserted` or a `beforedomnodeinserted` event. Assuming you can modify the JS that runs on the page, you can write equivalent code without any sort of event handling. – Matt Ball Apr 25 '11 at 14:50
  • I have to detect the paste events and if there is html inside I have to configure it, that's why I actually need it before the node is inserted :) – Shaokan Apr 25 '11 at 15:31
  • Then isn't some combination of `beforepaste` and `paste` events what you really want? – Boris Zbarsky Apr 25 '11 at 16:31

1 Answers1

0

No, there is no such event. There is nothing in the list of DOM mutation events specified by DOM Level 2 (or even DOM Level 3) that does what you want.

Tim Down
  • 318,141
  • 75
  • 454
  • 536