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

273
Views
Get site-URL-parameter from iframe (same domain)

I've got two html pages (site, sub). sub.html is embeded in the site page as an iframe. On the sub page I am running the following js:

    const queryString = window.location.search;
    const urlParams = new URLSearchParams(queryString);
    const param1 = urlParams.get('param1')
    const param2 = urlParams.get('param2')
    alert (param1 + param2)

It works fine. When I open .../sub.html?param1=hello&param2=world, I end up with "Hello World". But the URL-parameters are on "site.html" not on sub.html. So I open site.html?param1=hello&param2=world how do I get those URL parameters? I read that that is not possible if both sites are not on the same domain. In my case - they are on the same domain, so that should not a problem. At the time I am just testing it locally.

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!