I have a String that I need to pass by parameter. However the concatenated variable is interpreted as a new parameter and not a value. Is there a way to pass String by parameter with this character (&)?
Thank you in advance.
var codhtml = '&teste = 5';
$.ajax({
type: 'post',
url: 'salvarDados.php',
data: 'codhtml=' + codhtml + '&motivoid=2' + '&formatoid=2' + '&motivonome=Nome',
dataType: 'html',
success: function(txt) {
alert("Sucesso,");
},
error: function(result) {
alert("Erro ao Salvar");