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

263
Vistas
Encode special characters in URL for history.replaceState() : javascript

For my application in Javascript, I have to construct a URL which contains a param called 'name', whose value contains few special characters like

'.', '(', ')', '|', '#', '^', ',' etc

Eg: ../app/quest?name=list#2|#3

Due to some application restrictions, I have to encode only the special characters '|' and '^' in the name value.

I replaced '|' in "list#2|#3" with its encoded value "%7C" as "list#2%7C#3" and updated the URL using history.replaceState(stateObj, unused, url). But the value is not encoded and is passed as "list#2|#3" only.

How can forcefully pass the value in its encoded format itself ?

about 4 years ago · Santiago Trujillo
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