views:

635

answers:

1

Using javascript "window.close()" method after opening new window using "window.open", it serve the problem i.e. but it will ask a confirmation message to user whether he really wants to close the window or not... if user selects yes then the parent window will close and if not then he will remain on the same window and new window will not get open up..

So is there any way so that parent window will get closed without asking any confirmation message and new window will gets open up ?

+1  A: 

No. It´s a security feature. You are trying to manipulate an application on another users machine.

If you put it in another context it becomes clear why it is as it is and why it should be that way: Would you like if your email client suddenly closed cause you read an email?

EDIT: What you can do is having the login window trigger a navigate event in it´s opener so the first page gets replaced by the billing info page. Then it can close itself.

anddoutoi
Yes that is fine.. no body wants that his her email account would closed suddenly.. But here we are opening other window.. for the user and we are doing this for users convenience.. For example user gives his name and mobile number on our parent window and now we want that parent window gets closed and new window get open up with users billing information.
Yogi
You might think you are doing it for the users convenience but that´s a subjective opinion (imo). IAE it can´t be done cause of the security model. However, with your new description of what you want to achieve, I have updated my answer with a common solution on your problem.
anddoutoi
i have tried this code...window.opener = top;window.open('xyz.html','','','');window.close();and it helped... out... and it worked.By this sentence'login window trigger a navigate event in it´s opener' did u mean what i had done (above code).. then yes its working..
Yogi
Thanks..........
Yogi