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

110
Views
calling child url from parent page

I will need to call child url from parent url. Both are having different host . test.html is stored in the server, www.web1.com will load test.html and display this on www.prod.com

I am trying to capture the url that is showing from website1[www.web1.com] on website2[www.prod.com]

Flow is as shown below

enter image description here

  • server and website1 are linked and are using the same host hence there will be no issue

inside test.html , i have used console.log(window.top.location.href) , this will display "www.web1.com" on my console.log

on www.prod.com , it will load www.web1.com which consist of test.html , when window.top.location.href script that was declared in test.html and place in web 1 is loaded in website 2, this will cause DOMException cross origin error because the script is reading www.prod.com instead of www.web1.com. I have read through some source to use document.referrer , i am wondering if this is possible for web 2 to display "www.web1.com" on console.log when it loads web 1 on web 2

ideally , if we use window.location, this will load the top url of web ,

  1. if this is used on web1 , it will print www.web1.com
  2. if this is used on web2 , it will print www.prod.com

But as for the usecase i stated above, web2 should load and display web1 url on web2 console.log

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!