J
jackwootton
Hello,
Currently I use setInterval to call a function every 1.5 seconds. The
function checks the content of 6 divs on a page. The content of each
div is retrieved use innerHTML. If the content of the div has changed
since it was last checked (1.5 seconds previous), then I know the div
has been updated, and I need to do something.
My questions is: This seems to be a resource heavy and rather clunky
way of checking if a div has been updated. What I'd really like is to
be able to attach a listener to a div, the listener is triggered when
the div is updated.
Is there anyway of doing this? If not, is there anyway I could improve
my current method?
Many thanks,
Jack Wootton
Currently I use setInterval to call a function every 1.5 seconds. The
function checks the content of 6 divs on a page. The content of each
div is retrieved use innerHTML. If the content of the div has changed
since it was last checked (1.5 seconds previous), then I know the div
has been updated, and I need to do something.
My questions is: This seems to be a resource heavy and rather clunky
way of checking if a div has been updated. What I'd really like is to
be able to attach a listener to a div, the listener is triggered when
the div is updated.
Is there anyway of doing this? If not, is there anyway I could improve
my current method?
Many thanks,
Jack Wootton