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

124
Views
Actualizar variables de exportación desde los módulos.

Necesito transferir algunas variables de un script a otro en otra sección HTML, y esta nueva sección puede CAMBIAR esa variable. El problema es que este cambio no se actualiza.

Por ejemplo, veamos este código en mi HTML PRINCIPAL:

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

Ahora, en otro script que está en OTRO 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

PERO en mi HTML/script principal no se actualiza.

¿Cómo puedo actualizar las variables entre los códigos? Gracias de cualquier manera.

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Puede configurar las variables en HTML e importar las variables en js, pero tendría que actualizarse en HTML y el archivo js estaría importando las variables constantemente. Es más probable que tenga éxito importándolos desde 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!