7
I know that the MutationObserver()
was developed to detect HTML DOM changes.
But I’d like to know how it works in practice.
We create a hypothetical situation, how about?
There is a <div>
with id='hipotese'
(I believe she will be watched by your id
, correct?)
Is <div>
has several other contents within it, which are generated dynamically. (we have no control over the amount of content generated within it)
What happens is that there are several methods that act in these dynamic contents. (receive various parameters coming from these contents)
In Google Chrome we can press F12 and exit changing the attributes of this content in any way we want. And once changed when the call of methods happened, the returns would not be as expected (dynamically generated)
-- End of the hypothetical situation --
As I can observe and detect the smallest and simplest change in these elements present in our <div id='hipotese'>
?
Is there any other way to detect this change?
I know the user can disable the JavaScript
, but nothing that cannot be solved with the <noscript>
The part "What happens is that there are several methods that act in these dynamic contents" was particularly confusing for me. These methods are functions that alter content based on itself, since the parameters come from this?
– Woss