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

246
Vistas
JavaScript Console Changing String Text

I was just doing stuff in microsoft edge console, and I noticed that when I type in the following:

str = "<script>"

it returns with the value of the string as:

'<\script>'

Why did it add a backslash?

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

0

It's formatting it the way you should do it if you were writing the string in a <script> block of an HTML file. In these blocks you should not write <script> and </script> literally, because they'll be parsed as starting or ending the block. The escaped character prevents them from being recognized as those HTML tags.

This is somewhat related to Why split the <script> tag when writing it with document.write()?

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