1
I’m trying to enter the following code on this page to be able to change the text that appears when the customer subscribes to the modal newsletter, which appears when the customer is about to leave the page:
$(document).ready(function(){
$('#btn-cadastre').on("click", function() {
$('#modal_body_popup.modal-body-center .content-popup .newsletter-send').html('<i class="fa fa-check-circle"></i> Cadastro realizado com sucesso. Compre qualquer produto, seu cupom da <strong>Corda de Pular</strong> está garantido até o final da compra.');
});
});
Unfortunately, I don’t know for what reason, it’s not working. I’ve tried several ways and nothing. I would like some help to be able to solve this :)
PS.: I am using Tampermonkey v4.5 to do the tests.
I ran the tests if you were entering the function, and you’re not. Unfortunately I have no advanced knowledge of jQuery to solve this problem right away. But I tried to do it the way you told me, using $(Document). on and it didn’t work either.
– Leonardo Dias
I believe that the code I am putting, is coming before the modal code entered. How can this situation be circumvented?
– Leonardo Dias
In this case check the browser console for javascript errors. Click F12 and go to the Console tab. Paste the error here, if any
– Joao Paulo
Remembering that the jquery library must be referenced for the commands to work
– Joao Paulo
Unfortunately on the console there is no error. And the library is already referenced, as I make constant use of the library on the page.
– Leonardo Dias
I did a test inserting the code in the console after all the page loading and so it works. So I tried to make use of the code after all loading the page, but it didn’t work. Nor with setTimeout
– Leonardo Dias