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

279
Views
How to close popup and redirect to parent window?

Let there be three windows.

GrandParent->parent->child.

GrandParent opens parent and parent opens child.

In our case child closes automatically and returns to parent. but when parent is closed it doesn't return to GrandParent instead it goes to another tab.

I already tried the solution of creating a function in grandparent and calling it in parent. But it doesn't work.


// GrandParent 
window.open(url) // url to open payment gateway in popup

// add function in grandParent to focus on parent window when popup closes
window.receiveDataFromPopup = function(data) { console.log(data) };

// Now grandparent opens parent

// parent opens another popup(child) for OTP and closes after verification

// Now we are at parent 

// call grandparent function to focus on it
window.opener.receiveDataFromPopup('hola');

//close parent popup
window.close()
 
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!