I have a div which has its content changing all the time , be it ajax requests
, jquery functions
, blur
etc etc.
Is there a way how can I detect any changes on my div at any point in time ?
I dont want to use any intervals or default value checked.
Something like this would do
$('mydiv').contentchanged() {
alert('changed')
}
If you don't want use timer and check innerHTML you can try this event
More details and browser support datas are Here.
Attention : in newer jQuery versions bind() is deprecated, so you should use on() instead:
Try the MutationObserver:
browser support: http://caniuse.com/#feat=mutationobserver
Using Javascript MutationObserver
Use MutationObserver as seen in this snippet provided by Mozilla, and adapted from this blog post
Alternatively, you can use the JQuery example seen in this link
Chrome 18+, Firefox 14+, IE 11+, Safari 6+
You can try this
but this might not work in internet explorer, haven't tested it