0
I have a String that needs to be passed by parameter. However, the concatenated variable is interpreted as a new parameter and not a value. There is 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");
What HTML are you using? Maybe you can just do it
$('form').serialize();
and he does it for you... explain the question better and you’ll get better answers.– Sergio