I have two values that I want to include in a string:
json[key].id
which is integer type
json[key].descricao
which is of type string
I have a variable that gets these values like this (just getting the id) and works perfectly:
linha += "<td><a href='#' onclick='excluiFeira(" + json[key].id + ")'>Excluir</a></td>";
but (I think it's a concatenation error), when I include the description, the code does not work:
linha += "<td><a href='#' onclick='excluiFeira(" + json[key].id + ", '" + json[key].descricao + "')'>Excluir</a></td>";
I get the error:
SyntaxError: expected expression, got '}'