We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Changing DOM – re-register event listeners

Home Forums Puzzles Changing DOM – re-register event listeners

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #60250
    fred7
    Customer

    Hello,
    I got my configurator app working, running in an iframe, where I change the values in a parent html. Everything is working fine in my prototype.

    But in the final parent html done by someone else, the event listeners only work for the first event, as then it was explained to me, the DOM is changing and therefore I would need to “re-register” the event listeners.

    How would I do that? Is there an easy solution/workaround?

    Many thanks in advance!

    #60275
    kdv
    Participant

    https://stackoverflow.com/questions/2844565/is-there-a-javascript-jquery-dom-change-listener/11546242#11546242

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #60287
    fred7
    Customer

    Thanks for the link. I came across theMutationObserver method on my research. But I have no idea how to implement it and was hoping for an easy plug-and-play solution within Verge3D.

    Isn’t this a common problem? @yuri Is there a solution, or are you working on a feature for this?

    Thanks again!

    #60298
    kdv
    Participant

    and was hoping for an easy plug-and-play solution within Verge3D.

    vain hopes. it’s not implemented in Verge3D.

    Isn’t this a common problem?

    Nope, in fact it’s a very rare problem. You’re the first and only here.

    The mutation observer allows to detect which DOM elements were removed/added. You can filter them by id to re-add event listeners if needed. Without a live example it’s hard to say more.

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #60594
    fred7
    Customer

    Thanks for all the information and explanation!

    #60599
    kdv
    Participant

    not at all ))) I hope you managed to do what you wanted…

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.