According to the DOM events in the wiki, found in the wiki link here ,
DOMNodeInserted: fired when a node was added as a child of another node
DOMNodeInsertedIntoDocument: fired when a node is inserted into a document
Now what is the real difference? Shouldn't both events coincide? If not, when and where should I use it?
The scenario in which I use the aforementioned DOM events is that I have a set of pages and each page loads the nav.jsp file inside the div reserved for navigation. Now I want to highlight the current page navigation tab, so I give it a small background property after loading this DOM element (nav DIV).
Now for my problem
$(document).on('DOMNodeInserted', function(e) { if(e.target.id=="navigate"){
worked, but just curious, what is the difference between the two events mentioned in my question.
source share