-1

I am trying to debug an error on my code, I am using Apps Script and I know my error is related to JavaScript. To be more exact, here:

agendaColaboradores.append('<input class="elementoFormularioMovCob" type="time" id="movCobHoraEntradaES' + colaboradorTrim + '" name="movCobHoraEntrada' + colaboradorTrim + '"' + 'onchange="teste()"' + '>\r');

every time I edit the input, the onchange trigger works as expect. I know this because everytime I change the input value I get this error message:

Uncaught SyntaxError: missing ) after argument list (at userCodeAppPanel:1:40922)

With is useless since I can't check what is the code content. If i click userCodeAppPanel:1:40922 it's just show me a blank script.

Nothing in this error seems to make sense:

<input class="elementoFormularioMovCob" type="time" id="movCobHoraEntradaESAlexsandroLuizAlbani" name="movCobHoraEntradaAlexsandroLuizAlbani" onchange="teste()">

This is the result of the .append. A regular input element with no errors, it should just trigger teste() but I keep getting this content.

Wicket
39.6k9 gold badges81 silver badges201 bronze badges
asked May 16, 2022 at 18:32
2

2 Answers 2

0

Try it this way:

agendaColaboradores.append(`<input class="elementoFormularioMovCob" type="time" id="movCobHoraEntradaES${colaboradorTrim}" name="movCobHoraEntrada${colaboradorTrim}" onchange="teste();" />`);
answered May 16, 2022 at 20:03
Sign up to request clarification or add additional context in comments.

Comments

-1

write debugger in the first line of taste function and then trigger it from frontend , it should stop execution in the first line of dev tools and from there you can step till the line you get error

answered May 16, 2022 at 18:36

2 Comments

like this? function teste() { debugger alert("ha"); } I still receiving the same output: Uncaught SyntaxError: missing ) after argument list (at userCodeAppPanel:1:40922) change (async) onKeyDown_ @ unknown
I can't even find my js scripts in the dev tools. Probaly is something apps scripts is messing with

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.