473,486 Members | 2,131 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

open Centred popup and close parent window

Hi - Have tried for half and hour to get this script to work:

I am trying to close the parent window while opening a centred new
child window

I would be grateful if someone could correct the script below which
does open a new window, but not in a centred position.

Here is the link to the url:

www.amw1.com/ebay/newwindow.html

Here is the script I am using;

<head>
<title>new window</title>
<script language="JavaScript">
<!--Begin
window.onload = function() {

x=(screen.availWidth - w)/2;
y=(screen.availHeight - h)/2;
var
choose=window.open('http://www.sherlockholmesmuseum.com','Welcome','scrollbar s=no,resizable=no,width=300,height=200,status=no,l ocation=no,toolbar=no,menubar=no,top='+x+',left='+ y+',screenY=200,screenX=100');

}
// End -->
</script>
</head>

<body
onload="window.opener=top;window.open('http://www.sherlockholmesmuseum.com','Welcome','scrollbar s=no,resizable=no,width=300,height=200,status=no,l ocation=no,toolbar=no,menubar=no');window.close()" >
</body>

Dec 30 '06 #1
1 2448
Sorry - here is the full script:

<head>
<title>new window</title>
<script language="JavaScript">
<!--Begin
window.onload = function() {

x=(screen.availWidth - w)/2;
y=(screen.availHeight - h)/2;
var
choose=window.open('http://www.sherlockholmesmuseum.com','Welcome','scrollbar s=no,resizable=no,width=300,height=200,status=no,l ocation=no,toolbar=no,menubar=no,top='+x+',left='+ y+',screenY=200,screenX=100');

}
// End -->
</script>
</head>

<body
onload="window.opener=top;window.open('http://www.sherlockholmesmuseum.com','Welcome','scrollbar s=no,resizable=no,width=300,height=200,status=no,l ocation=no,toolbar=no,menubar=no');window.close()" >
</body>

www.sherlockholmesmuseum.com
Socrates wrote:
Hi - Have tried for half and hour to get this script to work:

I am trying to close the parent window while opening a centred new
child window

I would be grateful if someone could correct the script below which
does open a new window, but not in a centred position.

Here is the link to the url:

www.amw1.com/ebay/newwindow.html

Here is the script I am using;

<head>
<title>new window</title>
<script language="JavaScript">
<!--Begin
window.onload = function() {

x=(screen.availWidth - w)/2;
y=(screen.availHeight - h)/2;
var
choose=window.open('http://www.sherlockholmesmuseum.com','Welcome','scrollbar s=no,resizable=no,width=300,height=200,status=no,l ocation=no,toolbar=no,menubar=no,top='+x+',left='+ y+',screenY=200,screenX=100');

}
// End -->
</script>
</head>

<body
onload="window.opener=top;window.open('http://www.sherlockholmesmuseum.com','Welcome','scrollbar s=no,resizable=no,width=300,height=200,status=no,l ocation=no,toolbar=no,menubar=no');window.close()" >
</body>
Dec 30 '06 #2

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

Similar topics

1
3689
by: Marshall Dudley | last post by:
I have an application where in a shopping cart checkout a popup appears which suggests other items that may go with what was ordered with a button to add these items to the cart. When the button...
2
1275
by: Random | last post by:
To grossly oversimplify my webapp: I am using PHP to communicate with IMAP, outputting relevant information as JavaScript. The information is aggregated in an extremely heavily-scripted status...
23
6365
by: Markus | last post by:
Hi, i have this problem: Sometimes, i can't reproduce, if i click on an small image on the website, the popup _AND_ an other Tab in firefox open. Here are the linkcode: <div...
3
3776
by: Bob | last post by:
I am trying to create a popup page (to act as a menu) from a parent page. When the parent page (index.jsp) calls my popup function (see below) it will properly open the correct size browser window...
6
9845
by: mkobus | last post by:
Im relatively new, so please be patient with me... I need to update a parent .aspx screen from a popup and close the popup. Normally I would use...
15
10051
by: H00ner | last post by:
Hello All Hope you can help Been pulling my hair out about a popup problem in ASP.NET. One of the forms i wrote requires the user to select a product from a list in a popup web form. the...
3
4050
by: Aaron | last post by:
I am having a little difficulty with a relatively simple task. I have a parent webform. I have a javascript attribute added to a button to open a new window when clicked. The user fills in a...
3
3463
by: rick2910 | last post by:
Hello, I have a problem with a popup. In this popup (child) are several links. I want these links to open in A NEW parent window. Code: <a href="javascript:;"...
2
9832
by: sanscrimson | last post by:
Hi! I just want to ask if it possible to call functions in parent window if the child window is created. Below is sample:...
0
6964
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...
0
7126
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7175
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...
1
6842
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5434
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,...
0
3070
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1378
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
262
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...

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.