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

115
Views
Update export variables from the modules

I need to transfer some variables from one script to another in ohter HTML section, and this new section can CHANGE that variable. The problem is that this change doesnt update.

For example, let see this code in my MAIN HTML:

let array = [{name: 'John', ranking: 1000}, {name: 'Scott', ranking: 1200}, {name: 'Emma', ranking: 800}] // etc...
export { array }

Now, in other script that is in OTHER HTML:

import { array } from /.mainLocation/main.js
let newPlayer = {name: 'Richard', ranking: 1232}
array.push(newPlayer);
console.log(array) // [{name: 'John', ranking: 1000}, {name: 'Scott', ranking: 1200}, {name: 'Emma', ranking: 800}, {name: 'Richard', ranking: 1232}]
// Is updated

BUT in my main HTML/script it doesnt update.

How can i update the variables beetwen the codes?? Thanks anyway.

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You can either set up the variables in HTML and import the variables into js, but it would have to update in HTML and the js file would be importing the variables constantly. Your more likely to be successful importing them from html.

about 4 years ago · Santiago Trujillo 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!