Many times I have been asked how to close a parent window without getting that ugly warning dialogbox. You know what the solution is pretty straight forward :)
Script of the Parent window:
<html>
<head>
<Script language=""javaScript"">
window.opener=self;
window.close();
window.open('test.htm','Test','fullscreen');
</script>
</head>
<body>
</body>
</html>
Here 'Test' is a name of the window. You can give any name of your choice there. 'test.htm' is the name of the file which would be opened in fullscreen. This way we could avoid that ugly warning dialogbox.
Script of the Parent window:
<html>
<head>
<Script language=""javaScript"">
window.opener=self;
window.close();
window.open('test.htm','Test','fullscreen');
</script>
</head>
<body>
</body>
</html>
Here 'Test' is a name of the window. You can give any name of your choice there. 'test.htm' is the name of the file which would be opened in fullscreen. This way we could avoid that ugly warning dialogbox.
Comments
I tried this code.But not working .I dont know what is the problem.Can you help in this regard.
My code is as follows:
function samewindow()
{
window.opener=this;
window.close();
window.open("http://www.google.com");
}
this is called by a onClick event on a button.
Thanks in advance.
Satish
function shutwindow(){
window.open('','_parent','');
window.close();
}
Paul
Alok
function getpage()
{
window.open("","_self","")
window.close();
window.open("newpage.aspx","newpage","toolbars=no,location=no,resizable=no")
}
i am not being able to the parent window with this code using C# aspx from within a windows form...any hlep
Thanks
Now you've created a browser window created from javascript, it is just the same page reloaded, but this time from you page script.
Then myLoader will have:
widow.open('this same page','_self'); //open your page again, but this time from javascript, load in same window
window.opener=''; //not sure if needed, doesn't seem to hurt
window.close(); //this closes the original window
window.open('your target window'),'other','parameters as need')
When this page is called it reloads itself, opens the new target page in a new window, then closes itself. Now to get it to close in Netscape, that is a whole different story.
great..........
great..........
Its really awesome