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

Anchor link in new window loads parent


I create a new page and write to it. There is an anchor in the
new page so that users can easily navigate to the bottom. In
IE, it works fine. In Firefox, it loads the parent page into the
new page.

Any ideas?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
Transitional//EN">
<html><head><title> Z </title>
<script type="text/javascript">
function wrt(a,b) {
zWin = window.open('','result','width=550,height=200,menu bar=0'
+ ',toolbar=1,status=0,scrollbars=1,resizable=1');
zWin.document.writeln('<html><head><title>Report</title>'
+ '</head><body onLoad=\"self.focus()\" style=\"background-color
eee;\">'
+ '<h1>New Page</h1>'
+ '<table border=\"0\" width=\"100\%\">'
+ '<tr><td><h2>' + a + '</h2></td>'
+ '<td><a href=\"\#aLink\">Link</a>&nbsp;|&nbsp;'
+ '<a href=\"javascript:window.close();\">Close</a></td>'
+ '</tr></table><br><br><br><br>'
+ b
+ '<br><br><br><br><br>'
+ '<a name=\"aLink">You\'ve arrived at the link...</a>'
+ '<br>And are still in the New Page'
+ '<br><br><br><br><br><br><br>'
+ '</body></html>'
);
zWin.document.close();
}
</script>
</head><body>
<h1>This is the Start Page</h1>
<form name="F1"><input type="button" name="B1"
value="click to display window"
onclick="wrt(this.form.name,'the content');">
</form>
</body></html
-
Rob

Jul 23 '05 #1
1 1465
On Fri, 10 Sep 2004 01:33:41 -0500, RobG
<Ro*********@mail.forum4designers.com> wrote:
I create a new page and write to it. There is an anchor in the new page
so that users can easily navigate to the bottom. In IE, it works fine.
In Firefox, it loads the parent page into the new page.

Any ideas?
[snip]
zWin = window.open('','result','width=550,height=200,menu bar=0'
+ ',toolbar=1,status=0,scrollbars=1,resizable=1');


It's probably because there is no URL for the window, so Firefox takes the
parent window's base URL for this one, too. That's only a guess, though.

By the way, you could shorten the feature string to:

'width=550,height=200,toolbar,scrollbars,resizable '

[snip]

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #2

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

Similar topics

1
by: fogwolf | last post by:
First a basic outline of what I am trying to do: I want to have a page spawn a pop-up when you click "submit" on its form. On this pop-up page there will be another form. When you click "submit"...
4
by: catyionic | last post by:
Greetings: I have numerous links on index.html...example of one..... <A HREF="stage.html#Flash" target="left">Flash</A> It connects to page named stage.html ... which contains... <a...
36
by: randau | last post by:
I would like to use the Link Target attribute, but am inhibited by the likelihood of a newly opened browser window completely hiding the Parent browser window. Thus offering the illusion that...
8
by: scorpion53061 | last post by:
I have a datagrid that I create dynamically in code and want it to appear when a link label is clicked. The form loads in maximized view. When the datagrid appears though I have anchored it to...
1
by: axlq | last post by:
I'm trying to figure out how to make javascript set the scroll position of a page to an anchor that's specified in the page URL. You may ask, why? Doesn't the browser go there anyway when the...
0
by: LudwigWrules | last post by:
I have an iframe on my site. I need the frame to display its "child" page at a specific point. I can do this by setting an anchor, but it makes the parent window go there, too. I was thinking of just...
2
by: TheITGuyFromNY | last post by:
To set this up, I have a parent window with a list of things (doesn't matter what they are, but they are loaded by the page dynamically from a database with ASP server-side script. So, next to each...
11
by: nma | last post by:
Hi How can I make the anchor link once I do onclick? <td width="<?php echo ($cellwidth); ?>" height="17" bgcolor="#00ff00" onMouseOver="this.style.background ='red'" ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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
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...
0
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
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...

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.