473,839 Members | 1,358 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to link from a "pop-up" window

Hello, all, and TIA for any help you can offer. I've searched the
Internet for answers and have finally come here.

I've created a page (several, actually) with a link that opens a pop-up
window. It's a pop-up window in the sense that it's smaller than the
man page and is intended to be viewed and then closed.

The problem is that if I include a link on that pop-up window HTML
page, when the link is clicked the new page opens IN the pop-up window,
which is not at all what I want. I want the pop-up window and the
window it came from to be closed out altogether first so that the new
page, the I link to from the pop-up window, opens in the user's default
browser view and the original pages are "released."

You can see a sample of the originating page with a link on it that
opens a pop-up window, whereupon you'll see a test link to google.
Please go to http://barelybad.com/map_test.htm.

Please understand that I am nearly illiterate in Javascript. I can
follow directions, and I can adapt within reason, but I really will
need some pretty detailed instructions as to what goes where in which
HTML page.

Thanks again for your time.

Oct 24 '05 #1
3 2266
Jo******@gmail. com wrote:
Hello, all, and TIA for any help you can offer. I've searched the
Internet for answers and have finally come here.

I've created a page (several, actually) with a link that opens a pop-up
window. It's a pop-up window in the sense that it's smaller than the
man page and is intended to be viewed and then closed.

The problem is that if I include a link on that pop-up window HTML
page, when the link is clicked the new page opens IN the pop-up window,
which is not at all what I want. I want the pop-up window and the
window it came from to be closed out altogether first so that the new
page, the I link to from the pop-up window, opens in the user's default
browser view and the original pages are "released."

You can see a sample of the originating page with a link on it that
opens a pop-up window, whereupon you'll see a test link to google.
Please go to http://barelybad.com/map_test.htm.

Please understand that I am nearly illiterate in Javascript. I can
follow directions, and I can adapt within reason, but I really will
need some pretty detailed instructions as to what goes where in which
HTML page.

Thanks again for your time.


Using pop-ups like this is not liked much, better to use a normal menu
system. But anyhow...

The following script checks to see that the opener is not closed. If it
isn't it must be open, so its location.href is set to the value passed
to the function. If the opener is closed, the pop-up just closes.

In the HTML source for your popup, add the following in the head:
<script type="text/javascript">

function changeOpenerHre f(Href)
{
if (opener && !opener.closed) { // Make sure opener is open
opener.location .href = Href; // Change the href
}
window.close(); // Close the popup
}
</script>
To call the function, the href of the A element is used as a URL to pass
to the function using an onclick. This means that browsers that show
the href as a tooltip or in the status bar can still do so.

Change the link in the document body:
<a href="http://www.google.com"
onclick="change OpenerHref(this .href);">Google .com</a>

<a href="http://www.apple.com"
onclick="change OpenerHref(this .href);">Apple. com</a>

<!-- Add more ... -->

You can add lots of links and use the same function call each time.
--
Rob
Oct 24 '05 #2
RobG said the following on 10/24/2005 12:44 AM:
Jo******@gmail. com wrote:
Hello, all, and TIA for any help you can offer. I've searched the
Internet for answers and have finally come here.

I've created a page (several, actually) with a link that opens a pop-up
window. It's a pop-up window in the sense that it's smaller than the
man page and is intended to be viewed and then closed.

The problem is that if I include a link on that pop-up window HTML
page, when the link is clicked the new page opens IN the pop-up window,
which is not at all what I want. I want the pop-up window and the
window it came from to be closed out altogether first so that the new
page, the I link to from the pop-up window, opens in the user's default
browser view and the original pages are "released."

You can see a sample of the originating page with a link on it that
opens a pop-up window, whereupon you'll see a test link to google.
Please go to http://barelybad.com/map_test.htm.

Please understand that I am nearly illiterate in Javascript. I can
follow directions, and I can adapt within reason, but I really will
need some pretty detailed instructions as to what goes where in which
HTML page.

Thanks again for your time.

Using pop-ups like this is not liked much, better to use a normal menu
system. But anyhow...

The following script checks to see that the opener is not closed. If it
isn't it must be open, so its location.href is set to the value passed
to the function. If the opener is closed, the pop-up just closes.


That seems to be anti-user friendly, with the popup issue aside. Only
close the popup after the new URL has been addressed. If the opener is
closed, then open a new window.
In the HTML source for your popup, add the following in the head:
<script type="text/javascript">

function changeOpenerHre f(Href)
{
if (opener && !opener.closed) { // Make sure opener is open
opener.location .href = Href; // Change the href
}
else{
window.open(Hre f)
}
window.close(); // Close the popup
}
</script>


--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Oct 24 '05 #3
Thank you to RobG and Randy Webb for your help. The solution I
crafted based on your advice isn't ideal, but it's good enough.

Oct 26 '05 #4

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

Similar topics

12
3102
by: relaxedrob | last post by:
Hi All! I have a page with with the following style information: <link rel="stylesheet" type="text/css" href="/eEmployment/eTech.css" /> <style type="text/css"> DIV.Application { BACKGROUND-IMAGE:url(/someImage.jpg); }
2
1875
by: John Smith | last post by:
I have more than 4,000 pieces of email in my Yahoo account. I would like to write a program to download them all. In order to write such a program, I need to know a few things. 1. After I fill out userid, password, and click on "login", what exactly is sent to Yahoo? 2. When I click on "next" to fetch the next mail, what exactly is sent to Yahoo?
145
6364
by: Sidney Cadot | last post by:
Hi all, In a discussion with Tak-Shing Chan the question came up whether the as-if rule can cover I/O functions. Basically, he maintains it can, and I think it doesn't. Consider two programs: /*** a.c ***/
4
2480
by: trint | last post by:
Ok, I received info that this will work as a means of removing the border around a window that I create (which also loads an aspx file) in the firing file (aspx using javascript): OpenWindow = window.open("logon2.aspx", "remote", windowprops); But the code that removes its borders is in c#???: this.FormBorderStyle = FormBorderStyle.None; this.MaximizeBox = false; this.MinimizeBox = false;
4
3771
by: MrMike | last post by:
Hi. I have a hyperlink control (lnkViewLogData) which is assigned the following attribute when the page loads... Me.lnkViewLogData.Attributes.Add("onClick", _ "javascript:window.open('Input_New_Record_CustomerInformation.aspx?CustomerID=" & Me.lblCustomerID.Text & "','myWin','');") As you can see, when this attribute is assigned the hyperlink is formatted to pop open another window. The problem is that when the window opens, it...
1
3990
by: pbd22 | last post by:
Hi all. I am using styles to lock down the GUI until the user enters some info in a CSS/DIV pop box. If the user does now scroll before he clicks, the pop box is centered and the background color spans the entire page. But, if he scrolls first, say, to the middle of the page, then when the click happens you only see the bottom of
0
5453
by: oopaevah | last post by:
Hi, I have a set of valid xhtml pages that a third party web site is integrating with via an <iframein his own page. This retains his own branding template in the header and footer, with the iframe containing my pages in the middle of the screen. When it is time to exit my pages, to take the user back to the third party web site, I need to direct the browser out of the iframe and to one of his pages. I leave it at that and his site...
6
18239
by: mistral | last post by:
what is correct way open a PDF document in new window use hyperlink? I want show images thumbnails linked with PDF files, when click on thumbnail, PDF will be opened in new window. Some of PDF files are in the same web server, other are in a remote location. Any help will be appreciated.
3
2506
by: Ravigandha | last post by:
Hi every one. I am developing a online movie tickets website. And im struck at this point. I have a link when on clicking the link a pop window opens where in that how to display all the check boxes. When selected the check boxes and close the window the parent window have to display the selected values result without refreshing ! Any suggestion is very much needful to me !
0
9855
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9697
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10908
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10649
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10295
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9426
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7829
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4487
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 we have to send another system
3
3136
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.