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
How to decode URI string using javascript?

So I'm trying to decode this string %21%22%23%C2%A4%25%26%2F to !"#¤%&/ inside my confirm so it doesn't say the encoded string in the confirm, but the actual string. But how can I do this?

I tried something like this, but it doesn't work.

...
if(confirm('Are you sure you want to removed the JQL: ' + decodeStr(encoded_string_value))){
...
}

function decodeStr(strVal) {
    var decodeStr = '';
    if(strVal && typeof strVal === 'string') {
        // strip script/html tags
        decodeStr = strVal.replace(/<script[^>]*>([\S\s]*?)<\/script>/gmi, '');
        decodeStr = decodeStr.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gmi, '');
        return decodeStr;
    }
}

Is there another way of doing this?

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

0

Did you try?

decodeURI(strVal)

or

decodeURIComponent(strVal)
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