473,763 Members | 1,312 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Link from a popup needs to open a new parent window

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="javascrip t:;"
onclick="opener .location.href= 'http://www.test.com/'">Link name</a>

This does open the URL in the parent, but in the same window, and not
in a new one (or in case of Firefox, a new window OR a new tab).

There are a lot of samples all over the internet, but they all change
the parent window which is active, and do not create a new one.

Who can help me with a working sample? Or is it just impossible (I have
learnt that nothing is impossible though :)

Thnx,

Rick.

Nov 6 '06 #1
3 3492
ri******@lycos. nl wrote:
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="javascrip t:;"
onclick="opener .location.href= 'http://www.test.com/'">Link name</a>

This does open the URL in the parent, but in the same window, and not
in a new one (or in case of Firefox, a new window OR a new tab).

There are a lot of samples all over the internet, but they all change
the parent window which is active, and do not create a new one.

Who can help me with a working sample? Or is it just impossible (I have
learnt that nothing is impossible though :)

Thnx,

Rick.
Hi,

You don't open a new parentwindow. If you open a new window from another
window, the latter is a childwindow.
In your case you are trying to replace the location of the parent.

If you need a new window, just create it with window.open(... ), but it will
NOT be the parent window of the popup.

Also: this is not advised:
<a href="javascrip t:;" onclick="..">

href="javascrip t:" is called pseudoprotocol, and should be avoided.

try:
<a href="bla.html" onClick="doYour Stuff();return false;">

where bla.html is a reasonable alternative in case people have JS disabled.
the 'return false' makes sure that JS-enabled browsers will NOT follow the
link.

Regards,
Erwin Moller
Nov 6 '06 #2
ASM
ri******@lycos. nl a écrit :
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="javascrip t:;"
onclick="opener .location.href= 'http://www.test.com/'">Link name</a>
If you think you absolutely need to pass by the opener :

<a href="http://www.test.com/"
onclick="opener .foo=window.ope n(this.href,'', 'width=300,heig ht=300');
return false;">Link name</a>
<a href="http://www.test.com/"
onclick="opener .foo=open.windo w('','','width= 300,height=300' );
opener.foo.loca tion = this.href;
return false;">Link name</a>
Nov 6 '06 #3
Thank you for these ideas!

(although others may still be posted :)

Nov 6 '06 #4

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

Similar topics

38
5089
by: Shaun McKinnon | last post by:
HI...Here's my problem...I have a popup window that loads when i want it to, but it's not sized properly. I've set the size, but it doesn't seem to work. I've been on 8 different websites to find out what i'm doing wrong, and so far it seems i'm doing it the right way. Here's my code...any suggestions would be appreciated. <script language="javascript"> <!-- window.open("256fx/index.htm", "", "height=400, width=600"); //-->
4
22211
by: Davey | last post by:
I have a website which has a popup window (this only opens when the user chooses to open it). In the popup window I have a <select> control which lists a selection of "classes". Each class has a description and a class_id (stored in the value attribute of each option). The user will then select a class from the drop-down list. What I want to do is have a control in the parent browser window which can store the class_id and the...
1
11581
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at http://weblogs.asp.net/asmith/archive/2003/09/15/27684.aspx but it was far more complex then I needed. (I got lost trying to figure it all out). Therefore, here goes my simple "web dialog box with parent event handler fireing" solution. ...
5
2225
by: Etienne Charland | last post by:
Hi, I have a simple problem that doesn't seem to have an easy solution. I have a popup used in many places in the application. At the top of the page, there is a link to switch between two views of the data. And in both views, I need a reference to the opener window. The problem is... once I change view, window.opener loose it's reference. How can I work-around that? Since that popup is an utility used in many places, I must not have to...
5
8042
by: midnight_use_only | last post by:
hi all, quick question, how do you submit a form to a parent window from a child popup window? i have the following and all online documentation *suggests* that it should work but it does NOT: // Parent window: <script language="JavaScript"> function popup(url, name) { window.open(url, name, "width=800,height=600,scrollbars=yes");
3
3581
by: Opa | last post by:
Hi , I have a form with javasript which launches a popup via the showModalDialog() method. I get the dialog to open, now I am trying to first get a reference to the calling form from the popup and then do a refresh of the calling form. Any ideas on how to get a reference to the calling form? I tried window.parent.location.reload() , but it doesn't work. Thanks a lot.
2
2342
by: sangram | last post by:
i need a javascript for popup window and how to pass value to that new window from old window .
26
3006
by: Nospam | last post by:
I am trying to open a link in a new template window : <a onclick="windowopen('example.html','example');return false;" href="http://www.example.com" target="_blank"example link</a> such that clicking on the example link will open it in a new window in an already saved template/site/ called example.html
0
9563
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
9386
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
10145
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
9938
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
9822
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
8822
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
3917
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
3523
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2793
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.