1
I have an external widget that has a form, but I can’t change the way it works (because it’s proprietary). However I need to know when the user clicked on it to auto fill some fields like name and email, which are saved in my system session.
I was thinking of adding elemento.addEventListener('click', inserirDados);
.
But as it is asynchronous, I don’t know when it will finish being loaded. How can I do that? I don’t know if it’s important, but both my system and widget use pure javascript only.
The widget is inserted on the page with:
(function() {
//criação do <script>
//configuração
//inserção do script na página
})();
From now on, thank you!
What is your element where the
widget
is inserted?– Sergio
At the end of the body, with global scope, to be available throughout the system.
– Cleiton Oliveira