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

216
Views
How to get an external funtion in a .html?

I want to get a function or a variable into a .html code from a javascript code. I have to toggle layers of a map made on mapbox in a wix site. Have this click event that changes a bool in javascript:

$w('#au').onClick((event) =>{
if(isMatch)
{
    $w('#img').hide();
    $w('#Basic').hide();
    isMatch = false; 
}
else{
    $w('#img').show();
    $w('#Basic').show();
    isMatch = true;
}
});

Now I want to get this bool, or any another variable or function, and use it as a condition inside my .html, which is like this:

<script>

mapboxgl.accessToken = 'pk.eyJ1Ijoiam9hb3BlZHJvdmdhIiwiYSI6ImNreGtqMHZxZTJwcTIzMHB6Y2lnMm00czkifQ.auBfiQMlyayVxRlHCPuPkQ' 
;
const map = new mapboxgl.Map ({ 
container: 'map', 
style: 'mapbox://styles/joaopedrovga/ckxkj2aon1xh314me52nin8w8'
});
map.on('idle', () => {
"HERE I WANT TO CALL THE FUNTION OR GET THE VARIABLE"
map.setLayoutProperty('water', 'visibility', 'none');
});
about 4 years ago · Santiago Trujillo
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!