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

129
Views
Javascript variable scope & sharing content between files

A common question that I am struggling to make work -

Task:

Keyboard actions served to different pieces of my page

  • index.html using "<body onkeydown="onkeydown_resp()">"
  • onkeydown_resp() is in utils.js
  • page is hosting an iframe with projects.html
  • uses keyboard to stop/start some media

Need:

JavaScript state changes shared across Js & HTML content

e.g. onkeydown_resp() may -

  • Trigger the loaded iframe of projects.html to toggle to a new project (Key1)

  • Stop an animation for one of those project demos (Key2)

  • And toggle some audio (Key3)

I have tried a plethora of options to no success. I am just looking to learn & establish a portfolio demo for www.justinreina.com.

Question:

  • How can I get this task to work?

        Expected - create a global 'var' or window.myVar and share it

        Tried - None of these seem to work 1/2/3/4/5/6/7

about 4 years ago · Juan Pablo Isaza
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!