Right now, I am working with a page that is automatically updated and I’m using setInterval to check for new elements. I’d like to do this with events but I don’t know how to tell if an element has been added to the page via an event.
Is this possible?
There’s a mutation event that should do the job, but it’s not supported in IE (although it should be in IE9):
DOMNodeInsertedThere is no IE equivalent, so the best thing to do is use feature detection to see if it is available and fall back to your timer method if it isn’t.