0
I have two values I want to include in a string:
json[key].id
which is of the integer type
json[key].descricao
which is a string
I have a variable that receives these values like this (receiving only the id) and works perfectly:
linha += "<td><a href='#' onclick='excluiFeira(" + json[key].id + ")'>Excluir</a></td>";
however (I think it’s a concatenation error), when I include Description, the code does not work:
linha += "<td><a href='#' onclick='excluiFeira(" + json[key].id + ", '" + json[key].descricao + "')'>Excluir</a></td>";
get the bug:
Syntaxerror: expected Expression, got '}'
worked, only instead of using the simple quotes
\'
, I had to use the double quotes\"
– Italo Rodrigo
can correct the answer I give your points
– Italo Rodrigo