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

127
Views
open leaflet.js popup with a link

Is there an easy way to add a link for a specific popup in leaflet or any other javascript object?

I have a website with a lot of popups, this popup fetches a html file from a folder with a lot of text.

fetch('../assets/txts/4.html', {mode: 'no-cors'})
    .then(res => res.text())
    .then(data => text4 = data)
    .then(() => L.marker([331, 370], {
        icon: makerRot
    }).addTo(map).bindPopup(text4, {
        maxWidth: 800,
        keepInView: true,
        maxHeight: 500
    }))

when I type in example.com/text/text1.html I can see the text obviously, but when I click on the popup I stay on example.com

Is there a way to add a link (example.com/text4) so when I click the link it will open the right popup? And even better if I click the popup the url will be updated to the according link?

I know about section and #-anchors but could transfer this to my problem.

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!