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

87
Vistas
Javascript var inside another var

I'm JS novice, My problem is that I have a var resortuid its value is from PHP (it's working). I need to open a json file with resortuid in link. In other words I need to replace XXXX in url with resortuid var. I'm sure that it is a banal question, but not for me.
EDIT: codefrom first response is working on SO, but not in TYPO3 fluid template, my new question is how to pass it to fluid template?

var resortuid = '1125';
var settings = {  
    "url": "https://aaa.aa/XXXX_simple.json",
    "method": "GET",
    "timeout": 0,
};
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can use JavaScript Template literals:

const resortuid = '1125';
const settings = {  
  "url": `https://aaa.aa/${resortuid}_simple.json`,
  "method": "GET",
  "timeout": 0,
};
      
console.log(settings.url)

By the way, Var, Let, and Const – What's the Difference? might be worth reading.

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