Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

85
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda