473,545 Members | 73 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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>MySideBa r</title>
<body bgcolor="#FFFFF F" onLoad="OpenSid eBar()">
<script language="JavaS cript">
<!--
// 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(3 00,300)
window.open("ht tp://www.google.ca", "MySideBar","wi dth=150,height= 965,left=0,
top=0,location= no,menubar=no,r esizable=no,scr ollbars=yes,sta tus=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 3064
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>MySideBa r</title>
<body bgcolor="#FFFFF F" onLoad="OpenSid eBar()">
<script language="JavaS cript">
<!--
// 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(3 00,300)
window.open("ht tp://www.google.ca", "MySideBar","wi dth=150,height= 965,left=0,
top=0,location= no,menubar=no,r esizable=no,scr ollbars=yes,sta tus=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("ht tp://www.google.ca", "MySideBar","pa rams_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******** ************@co mcast.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>MySideBa r</title>
<body bgcolor="#FFFFF F" onLoad="OpenSid eBar()">
<script language="JavaS cript">
<!--
// 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(3 00,300)
window.open("ht tp://www.google.ca", "MySideBar","wi dth=150,height= 965,left=0, top=0,location= no,menubar=no,r esizable=no,scr ollbars=yes,sta tus=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("ht tp://www.google.ca", "MySideBar","pa rams_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
9695
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 click that opens the site in a new and larger window via onclick. My question is, can I have the smaller window automatically close when the user...
2
3309
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
2932
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 window finishes loading? i've been racking my brain on this for the last two days. here is the code for the parent window that i have been testing...
7
1892
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 the original main window changes and the window get focus. Uses <script language="JavaScript"><!-- name = 'mainwindow';
4
5655
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 that i cant disable this so i thought is it possible to do a check to see if a hidden text on the main form has a value. E.g. if we close the popup...
2
1657
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 different forms.In my Main Page I have written a javascript code function ConfirmClose() { confirm("Are you Sure You Want to Close This Main...
5
2025
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 insert the date to the calling page I get the error "A runtime error has occured Line 14
7
2502
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 below, both the main and child disappears(this is due to pop up blocker) disappears suddenly. I want to make the browser know if pop up blocks the...
1
4454
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 parent window name is "main". A made a link like this in the child-site: <a href="new_address.html" target="main" class="about"...
0
7455
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7390
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7802
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7743
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5959
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5319
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4940
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3437
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
692
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.