V
V
VVVVVV dad2018-01-29 22:09:28
JavaScript
VVVVVV dad, 2018-01-29 22:09:28

JS\JQ | Chatik and addEventListener. What events do ama use?

Drsty, I'm worried about this question, there is such a thing as addEventListener , and all that hits it in gogol is onClick examples. I need to connect a reader to a certain element, by id, which will perform the function when creating its childs.
In other words, when a message appears in the chat, the handler should be triggered.
Right now I have setInterval to 250ms, and var= lastmessage (ctr, at == messageNow , return 1; ).

Briefly : You need to take every message from the chat, without timers, because. Messages can arrive at the same time, in the same MS, and timers are evil

Maybe there is some library, like JQ, that simplifies life\created to solve this problem .. // Holy naivety

:)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kulaeff, 2018-01-29
@Vadyanga

You need something like this: Mutation Observer .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question