0

I have a window(1) that has a button(1). If I click on the button, then another window(2) will appear. It also has a button(2). If I click on the button (2) then popup will appear. How can I close the window(2) if I press "OK" on the popup window? I am using javascript.

1

2 Answers 2

1
// store reference to window
var window2 = window.open(...);

// close window via reference, put this in your OK button handler
window2.close();
Sign up to request clarification or add additional context in comments.

Comments

0

Read here about window management.

You cannot do it according the security assurance of browser, there are some action which doesn't allow to be managed directly via javascript without user interference.

Got this from here /stackoverflow/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.