I have a onclick event in the main window. On clicking, a popup is opened using window.open(someurl.com)
. In the popup(someurl.com) there is a clickable item. When that item is clicked it opens the url in a new tab. When that new tab is now closed the popup windows does not remain in focus. Instead the main window is in focus and the popup goes behind the main window. What I want is, when the tab (which is opened from the popup) is closed the popup should get focus and not the main window. Is that possible? Please help me in how to achieve this? The important thing is, I do not have control on the popup url. It is an external url which is not in my control.
Thank you,
Asked
Active
Viewed 135 times
0

rsj
- 61
- 1
- 2
- 8
-
Please share the code – Amila Iddamalgoda Mar 11 '14 at 04:47
-
1@AmilaIddamalgoda, The relevant piece of code is in my original post. window.open(someurl.com). I do not have control on someurl.com. – rsj Mar 11 '14 at 04:52
-
i think it is impossible, you can try with jquery ui dialog. here is the reference http://stackoverflow.com/a/15459179/2567813 and http://stackoverflow.com/a/14021220/2567813 – CJ Ramki Mar 11 '14 at 04:52
-
It should be possible. I came across a website which had the same intended behviour that I wanted. I do not recollect which website was that. But I think certainly doable... – rsj Mar 11 '14 at 05:01
-
Any suggestions that I can try. – rsj Mar 11 '14 at 17:29
1 Answers
6
May be this will work:-
var myWindow = window.open("", "", "width=200, height=100");
myWindow.focus();

monu dwivedi
- 550
- 7
- 15