473,386 Members | 1,630 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

need to close main window

I use the script below to open a side panel on my desktop without all the
buttons and menu items. IE 6
It works well.
What I'd like to add is add a line of code that will close the calling
parent window (right now I make it visible by resizing it and clicking on a
close link). I'll even settle for having to confirm the closure but, the
ultimate would be that it would close by itself.

KD

================================
<html>
<title>MySideBar</title>
<body bgcolor="#FFFFFF" onLoad="OpenSideBar()">
<script language="JavaScript">
<!--
// This function moves the window when the page is loaded
// to the top left corner and resizes it then opens a side window panel
// ideally I want it to close the calling browser window, even if asked to
confirm
//
function OpenSideBar()
{
self.moveTo(0,0)
self.resizeTo(300,300)
window.open("http://www.google.ca","MySideBar","width=150,height=965,l eft=0,
top=0,location=no,menubar=no,resizable=no,scrollba rs=yes,status=no,toolbar=n
o,fullscreen=no")
}
function CloseWindow()
{
self.close()
}
-->
</script>

<div align="right">
<table border="0">
<tr>
<td><a href=javascript:CloseWindow()> Close Window</a>
</tr>
</table>
</div>
</body>
</html>


Jul 20 '05 #1
2 3045
kevin dalby wrote:
I use the script below to open a side panel on my desktop without all the
buttons and menu items. IE 6
It works well.
What I'd like to add is add a line of code that will close the calling
parent window (right now I make it visible by resizing it and clicking on a
close link). I'll even settle for having to confirm the closure but, the
ultimate would be that it would close by itself.

KD

================================
<html>
<title>MySideBar</title>
<body bgcolor="#FFFFFF" onLoad="OpenSideBar()">
<script language="JavaScript">
<!--
// This function moves the window when the page is loaded
// to the top left corner and resizes it then opens a side window panel
// ideally I want it to close the calling browser window, even if asked to
confirm
//
function OpenSideBar()
{
self.moveTo(0,0)
self.resizeTo(300,300)
window.open("http://www.google.ca","MySideBar","width=150,height=965,l eft=0,
top=0,location=no,menubar=no,resizable=no,scrollba rs=yes,status=no,toolbar=n
o,fullscreen=no")
}
function CloseWindow()
{
self.close()
}
-->
</script>

<div align="right">
<table border="0">
<tr>
<td><a href=javascript:CloseWindow()> Close Window</a>
</tr>
</table>
</div>
</body>
</html>


<script type="text/javascript">
window.open("http://www.google.ca","MySideBar","params_here")
window.opener = window;
window.close();
</script>

Is all you need.

--
Randy

Jul 20 '05 #2
Thanks for the Tip - works like a dream.
KD

"Randy Webb" <hi************@aol.com> wrote in message
news:Hr********************@comcast.com...
kevin dalby wrote:
I use the script below to open a side panel on my desktop without all the buttons and menu items. IE 6
It works well.
What I'd like to add is add a line of code that will close the calling
parent window (right now I make it visible by resizing it and clicking on a close link). I'll even settle for having to confirm the closure but, the ultimate would be that it would close by itself.

KD

================================
<html>
<title>MySideBar</title>
<body bgcolor="#FFFFFF" onLoad="OpenSideBar()">
<script language="JavaScript">
<!--
// This function moves the window when the page is loaded
// to the top left corner and resizes it then opens a side window panel
// ideally I want it to close the calling browser window, even if asked to confirm
//
function OpenSideBar()
{
self.moveTo(0,0)
self.resizeTo(300,300)
window.open("http://www.google.ca","MySideBar","width=150,height=965,l eft=0, top=0,location=no,menubar=no,resizable=no,scrollba rs=yes,status=no,toolbar=n o,fullscreen=no")
}
function CloseWindow()
{
self.close()
}
-->
</script>

<div align="right">
<table border="0">
<tr>
<td><a href=javascript:CloseWindow()> Close Window</a>
</tr>
</table>
</div>
</body>
</html>


<script type="text/javascript">
window.open("http://www.google.ca","MySideBar","params_here")
window.opener = window;
window.close();
</script>

Is all you need.

--
Randy

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Carol Lyn | last post by:
Could use your assistance with this. I have a window that opens via onclick and it is a small window with info about a site. If the user is interested in visiting that site, there is a link to...
2
by: Martin Nadoll | last post by:
Hello, i want to close a popup-window with the onBlur eventHandler. function closeIt() { setTimeout('window.close()',2000); } <body onBlur="closeIt()"> html </body>
11
by: JSjones | last post by:
when a form is submitted from the main window i want a pop up window to open from the onclick event. i have that working, now how can i close the pop up window from the main window after the main...
7
by: Jens Peter Hansen | last post by:
Hi From my main window I open a series of popup (one close - next opens) in a mockup for a registration proces. From the last popup, I want to click a buttom, so the popup closes and the URL in...
4
by: Colin Graham | last post by:
Hi guys, Just a quickie here that i hope someone can help me with. Basically i want stop the user from closing the popup window using the small x button in the top right hand corner. Im aware...
2
by: Sunil Sabir | last post by:
Dear All, I have a Main Asp.Net page . In that Page I have a Tab Strip which has SIX tabs each representing a different web Forms.So that when a user clicks different tab he can navigate between...
5
by: Chris | last post by:
Hi, I have been trying for days, yes days, to use the calender from the asp.net timetracker starter kit. I am now frustrated. I finally get the popup calender to popup but when I click ok to...
7
by: Jaggu | last post by:
Hi , I need to close main window, once the child window succesfully opens else main window to remain. In my case when I close the main window immediately after the "window.open()" as mentioned...
1
by: michal.podlewski | last post by:
Hi All, I have a problem with a simple (as I thought till now) thing: I want to make a link in a child-window which would change site in the parent-window and along with closing child window. The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.