473,778 Members | 1,910 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Web links (open's only one window)

tusovka
23 New Member
I have a php function that creates different links to a particular column in my <table>.
The links work great, one problem though. Say your on the main page and you click one of the links that were generated. First, a new window opens (_blank) and address of the link is executed. So for the first click everything is great. But if you go back to the main page and clink on a different link, it will just load a new page in the child window.

What I need is a new window to open for each link, not just one new window and when you go to the parent page and clink on a different link it will update the page in only one spot.

Windows [ parent with all links] [child that displays link destination]



// for loop {
//
// "<a href=$temp_web_ link target=\'_blank \'>$temp_testca se_value</a>";
//
// }
Jul 10 '09 #1
3 2608
dlite922
1,584 Recognized Expert Top Contributor
I'm not sure I understand.

You want your page's menu links to open in a common window.

First click...opens new window
Second click in the parent window...update s the window opened by the first click.
so on and so forth?

Just create a window "name" instead of _blank, call it tusovkas_window .

If the windows does not exist, it will be launched, if it does exist, it will be updated.

(I think, haven't done this myself, but try it out)

Let me know,


Dan
Jul 10 '09 #2
dlite922
1,584 Recognized Expert Top Contributor
some code that may be of interest:

Expand|Select|Wrap|Line Numbers
  1.  
  2. <html>
  3. <head>
  4. <script type="text/JavaScript" language="JavaScript 1.0">
  5.  
  6. function goToAddress(location,window)  {
  7.     myWindow= window.open(location, window,"location=0,status=0,scrollbars=0,width=500,height=300");
  8.  
  9. }
  10.  
  11.  
  12. </script>
  13. </head>
  14. <body>
  15.  
  16. <a href="#" onclick="goTo('http://www.google.com','myWin')">Link one</a>
  17. <a href="#" onclick="goTo('http://www.bytes.com','myWin')">Link two</a>
  18.  
  19.  
  20. </body>
  21. </html>
  22.  
  23.  
*This new window is not blocked by popup blockers because it is user-triggered.

Good luck,



Dan
Jul 10 '09 #3
tusovka
23 New Member
// for loop {
//
// "<a href=$temp_web_ link target=\'_blank \'>$temp_testca se_value</a>";
//
// }

Changed to

$i=0;
// for loop {
//
// "<a href=$temp_web_ link target=$i >$temp_testcase _value</a>";
// $i++;
// }

Now every time a link is created a new target is generated. That is what i wanted. So if you click on a link, it will not overwrite an existing page.
Also, if a user has clicked 5 different links from my main page. I will have a total of 6 pages open. One main page and 5 targeted links.
If a user goes to the main page an click a link that is open in the back ground the page will just refresh.

Basically this is the functionality I was going for.

Tusovka
Jul 13 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1878
by: kelli | last post by:
I am using an iframe to feed an RSS but when i click on the link on the iframe it opens the link on the iframe instead of opening it on the parent window or a new window.. the code is in php.. its something like this.. $item->source = $SERVER_URL; how can i make the links open in a new window or the parent window and not on the iframe .. Thanks Kelli...
1
1448
by: jackogreen | last post by:
Hi, My Asp database generated pages' content links all open a new window containing the same page by default; this is strange since the default behavior for anchor links is to open in the same window; I can and have corrected this with target="_self" but I have additional anchor links that call JavaScript to submit a form and these aren't stopped from opening the new window by the "_self" value. Interestingly, once the new window is...
4
4234
by: Jon | last post by:
I have links that open https secondary windows using: window.open(url, windowName); The windowName is always the same but I keep getting new windows. Is it possible for each of the links to open in the same window? Thanks, Jon
10
2396
by: Simon Wigzell | last post by:
Is there any way to create and open a window in javascript so that links in other websites won't "steal" it? I've written a web page with a form for people to enter headlines and URLs from newspapers. They will want my window to stay there as they surf through various online newspapers. We don't want their popup links to take over my form window! This is a real problem - it renders my web page useless and wastes peoples time.
1
317
by: HGJS | last post by:
I would like to place a single piece of JavaScript at the top of m intranet page/s to tell every link on that page to open in a certai target window, depending on the "hostname". Suppose my intranet address was http://intranet_01 If I wanted all of the links on a page that were linked to files withi the intranet to open in a new window, would I place a piece of cod like this at the top of the page:
44
9456
by: Viken Karaguesian | last post by:
Hello all, On occasion I want to open hyperlinks (images, etc.) in a new window. In the past, I've used target="_blank" to open the link in a new window. However, using the "target" attribute causes my pages to fail validation (strict doctype). The validator says "There is no attribute 'target'.." So...how do I open a link in a new window, without Javscript, and pass strict validation?
13
3338
by: Geoff Fox | last post by:
I am in the final moments of designing a new website. One of the pages (http://www.auditionfactory.com/samples.php) has four links to show sample work. I would like these links to open new browser windows when clicked. I have found scripts that will allow one to open, and a few that claim to all multiples to be opened, but so far nothing that will allow a user to open multiple new windows as they click to see new samples. Does anyone...
1
5532
by: nsvmani | last post by:
Hi, i am trying to get the FileOpen dialogue window as soon as clicked href link I am using IE6 with ActiveX enabled. Just need to get the File Open dialogue window when i click on the HREF links.It would be great , if i know how to create the dynamic HREF links like it should be getting different document based on each userid. Here is my part of jsp code for your reference: <%@ page...
6
2258
by: Inny | last post by:
Hi Im looking for a way to open all links (in a child window) in the parent window instead. I want this to happen Automatically because links in my child are called from the parent but I cannot alter link targets. <base target="x">(in child head tags) dont work, though some will launch a new window. I found this code idea that does work (see below) but I have no way of assigning the 'loadinparent' attribute to my childwindow links. Can I do...
0
9629
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
10298
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...
0
10127
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9923
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
8957
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...
0
5500
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4033
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
2
3627
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2865
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.