1
Some javascript functions do not allow empty spaces between characters. An example, in my case, was the add()
. I’m using to add a classList
var nomediv = 'Antônio João';
element.classList.add(nomediv);
How to solve?
element.classList returns a DOMTokenList
element class attributes. element is a Domtokenlist representing the elementNodeReference class attribute. Therefore, it is known that as a rule, não é permitido espaços para compor o nome de uma classe
. And to solve the error was implementing a simple REGEX:
var nomediv = 'Antônio João';
element.classList.add(nomediv.value.replace(/\s/g, '') );
What code is generating this error? It matters what’s on and around the 1202 line.
– bfavaretto
@bfavaretto, you are the best . ONLY this simple observation helped me to identify the error. vlw!!!
– Lollipop