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

169
Vistas
javascript friendly replacement for ' character available?

on my xpage I set a javascript variable onload:

var custName = '#{javascript: matterBean.getMatter().getCustomer().getCustName();}';

this variable I use to replace later the title of a bootstrap dialog.

I notice names with the ' character in it break the code.

I could replace it with

var custName = "#{javascript: matterBean.getMatter().getCustomer().getCustName();}";

but then this would break if the name contains the " character.

Is there an alternative, a javascript friendly replacement so the back-end code (java) could return a javascript friendly replacement for the ' character?

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

0

You can use Apache Commons StringEscapeUtils for escaping the string. Example:

StringEscapeUtils.escapeJavaScript(str);
about 4 years ago · Juan Pablo Isaza Denunciar

0

StringEscapeUtils.escapeJavaScript(str);
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