473,242 Members | 1,542 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,242 software developers and data experts.

Advanced POP Up Window Functions - Is this possible ?

Hi,

I want to create a popup window that opens when the index.htm page
loads..

Within the popup window, I want to create a link to 'more info'.

When this link is clicked, I want the content to load in the main
window, not the popup, and I'd like the popup to close !

Can this be done ??

How ? and URLS, or working examples ??

Many Thanks

Tom
Jul 23 '05 #1
3 2951
TomT wrote:
Hi,

I want to create a popup window that opens when the index.htm page
loads..
Stop now. You can't reliably open a popup window onload of a page.
Within the popup window, I want to create a link to 'more info'.
When this link is clicked, I want the content to load in the main
window, not the popup, and I'd like the popup to close !
Then why the popup at all?
And, what happens if they *dont* click the link?
Can this be done ??
Not reliably.
How ? and URLS, or working examples ??
There aren't any.
Many Thanks


Many Welcomes.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/
Jul 23 '05 #2
> Can this be done ??

Yes, this can be done

in the header of the main html document write the following code:

<SCRIPT LANGUAGE="JavaScript">

window.attachEvent('onload', function() {
window.open("your-url.html","moreinfo", "width=300,height=200");
});

</SCRIPT>

Now in the more-info popup html do the following in the header:

<SCRIPT LANGUAGE="JavaScript">

function moreInfoClicked() {

// address to load
url = 'http://yoursite.com/moreinfo.html';

// check if the opener exists and it isn't closed
if (window.opener && (!window.opener.closed)) {
// its not closed, load the URL in the window
window.opener.location.href=url;
} else {
// if it is closed, open a new window
window.open(url, "_blank", "status=1, menubar=1,"+
"scrollbars=1,resizable=1, toolbar=1,location=1");
}
// close current window
window.close();
}

</SCRIPT>

<A HREF="#" onClick="moreInfoClicked();">more info...</A>

see window.open for more info:
http://msdn.microsoft.com/workshop/a...ods/open_0.asp
Good luck,
Vincent

Jul 23 '05 #3

Thanks..

That seems to work great !

Tom
On Fri, 25 Jun 2004 11:27:40 +0200, Vincent van Beveren
<vi*****@provident.remove.this.nl> wrote:
> Can this be done ??


Yes, this can be done

in the header of the main html document write the following code:

<SCRIPT LANGUAGE="JavaScript">

window.attachEvent('onload', function() {
window.open("your-url.html","moreinfo", "width=300,height=200");
});

</SCRIPT>

Now in the more-info popup html do the following in the header:

<SCRIPT LANGUAGE="JavaScript">

function moreInfoClicked() {

// address to load
url = 'http://yoursite.com/moreinfo.html';

// check if the opener exists and it isn't closed
if (window.opener && (!window.opener.closed)) {
// its not closed, load the URL in the window
window.opener.location.href=url;
} else {
// if it is closed, open a new window
window.open(url, "_blank", "status=1, menubar=1,"+
"scrollbars=1,resizable=1, toolbar=1,location=1");
}
// close current window
window.close();
}

</SCRIPT>

<A HREF="#" onClick="moreInfoClicked();">more info...</A>

see window.open for more info:
http://msdn.microsoft.com/workshop/a...ods/open_0.asp
Good luck,
Vincent


Jul 23 '05 #4

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

Similar topics

4
by: Nhmiller | last post by:
This is directly from Access' Help: "About designing a query When you open a query in Design view, or open a form, report, or datasheet and show the Advanced Filter/Sort window (Advanced...
4
by: st_ev_fe | last post by:
Hi people, I've been doing C for about 7 years now. But I'm new to C++. I've decided that C++'s operator overloading could be very handy. I'm writing something much like auto_ptr, except for...
5
by: zkvneml | last post by:
Hi guys, Is there a way to retreave the javascript functions' names on the page? The javascript functions are properties of the global object (window/frame), but I do not know how to collect...
9
by: Let_Me_Be | last post by:
Hi all, I'm developing a small defensive programming toolkit for my own projects. So, here are my questions. 1) Is it possible to move from something like this: SAFECALL(foo();) to __safecall...
2
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:...
15
by: Nayan | last post by:
Hi, Can anyone suggest working sample of capturing a window's picture? I tried a few, but couldn't get the image. I don't know why those functions are not getting the image. Note: I want the...
5
by: lilOlMe | last post by:
Hi there! I'm developing some crazy Tab Control in .NET that uses JavaScript. A particular JavaScript method needs to be called during the window.onload event in order to initialize my Tab...
11
by: sunnyalways4u2000 | last post by:
hello sir, Sir will please tell me the exact difference between C and advanced C...what are the extra features or funcions...etc added in this advanced one.
0
by: JOHNSHELL08 | last post by:
Dear sir , I found the window xp advanced.really it's very beautiful look so please give me the knowledge about window xp advanced and also its download link.
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.