Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

84
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!