For a script that needs to be run on multiple pages with different coding etiquettes, I need to be able to figure out when there is some dynamic change occuring in the DOM. MutationObservers cater for Chrome and Firefox but I'm having problems with IE so onpropertychange event is something I've chosen to use as it appears to be the only thing that MAY give the behaviour I want.

document.attachEvent("onpropertychange", doThis);

The above is the function which fires the doThis method whenever something occurs. But some of the pages my script needs to run on have unlimited scrolls (similar to what Facebook, LinkedIn have) and rescanning the entire page each time the event fires in order to detect that element where a property was changed is very resource intensive.

If only there was some way to get the particular element that caused the propertychange I would be so happy..

Recommended Answers

All 3 Replies

How exactly do any of the links help in this case. None of them give a method of getting the specific element which was changed (or did I perhaps miss something?)

Member Avatar for LastMitch

How exactly do any of the links help in this case.

It tells you that only that onpropertychange event works only on IE specify. I gave you a answer it's a workaround. It might not be a straight answer because you need a code that will give you that feature.

None of them give a method of getting the specific element which was changed (or did I perhaps miss something?)

There is some code snippets in the link which you can used as a workaround. You modify the code to suit your code another words you have to debug it.

Workaround is something hard to help anyone because it depends how is our function works. Another words it varies and you have to debug it on your own that is why it is called a workaround.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.