DOMNodeInserted
イベントは、ノードが「追加される」または「追加される」ときに呼び出されますか?
次のコードがあるので、私はこれを尋ねます:
function AddTextToContainer () {
var textNode = document.createTextNode ("My text");
var container = document.getElementById ("container");
if (container.addEventListener) {
container.addEventListener ('DOMNodeInserted', OnNodeInserted, false);
}
container.appendChild (textNode);
}
そしてそれ:
function AddTextToContainer () {
var textNode = document.createTextNode ("My text");
var container = document.getElementById ("container");
if (textNode.addEventListener) {
textNode.addEventListener ('DOMNodeInserted', OnNodeInserted, false);
}
container.appendChild (textNode);
}
どちらもOnNodeInserted
Chromeで呼び出します。バグですか?