Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

221
Vistas
DecodeURI for query parameter in URL does not work

Since the value parameter has characters that are not read, such as the " " where the value is found where it is encountered, I tried to pass in the URL in reference to the decodeURI value but it doesn't work.

Can you kindly help me with this?

<a href="updatebook.html?id=${item.id}&number=${item.number}&value=decodeURI${item.value}">${item.type}</a>

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You have 2 problems with your code.

The first is that you are using decodeURI function but you should use encodeURI function.

The second problem is that you are not calling the function, you forgot the ( and ).

Update:

As pointed out by @deceze, the third problem is the function call needs to be inside the ${}.

All put together, it should be:

const item = {
    id: 1,
  value: 'https://stackoverflow.com?q=hello world',
  type: 'bar'
};

let link = `<a href="updatebook.html?id=${item.id}&number=${item.number}&value=${encodeURI(item.value)}">${item.type}</a>`;

console.log(link);

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda