0
I created a php page and when I pass it via GET to another ,presenting the + sign when saved in a cookie. This + is code encoding %20.Any know how to remove that %20 from the url?
link: page.php? value=%20meuvalor
code snippet
$('.grupos').click(function () {
var valorGrup= $(this).text();/pega o texto contido no elemento cuja classe é (.grupos)
$('.grupos').attr('href','pagina.php?
nomeGrupo='+valorGrup);//adiciona um link na classa .grupos
});
In fact, the character
%20
is a blank space, so probablyvalorGrup
has a white space at the beginning.– Woss
Try using . Trim():
var valorGrup= $(this).text().trim();
– Sam
@Andersoncarloswoss you were right. I used an expression to remove the whitespace. And it worked. The strange thing is that it was generating a +.But it has been solved.Thank you.
– thiago xavier