-2
My function returns the following error:
Uncaught Syntaxerror: Unexpected string
How can I correct?
function setarRegistro() {
campos = "teste="+encodeURI(document.getElementById('teste').value).
"&nome="+encodeURI(document.getElementById('nome').value).
"&sobrenome="+encodeURI(document.getElementById('sobrenome').value).
"&usuario="+encodeURI(document.getElementById('usuario').value).
"&email="+encodeURI(document.getElementById('email').value).
"&senha="+encodeURI(document.getElementById('senha').value);
}
Curiosity: why in a moment you use
+
to concatenate and in others you use the.
?– Woss
You must use the
+
to concatenate.– Caique Romero
You’re confusing PHP with Javascript?
– Sam
As I said, I was testing, precisely the mistake was concanetation, had seen somewhere the use of . and I thought it would work, I appreciate the answers.
– Igor Carvalho