Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to avoid new window opens when using anchors?

Status
Not open for further replies.

kippie

Technical User
Nov 8, 2001
158
In the HTML below I use some simple anchors. When this HTML is mailed to "mail.com" and opened in "mail.com" a new window opens each time you press on an anchor. The only good thing is that the position in the new window corresponds correctly to the position of the anchor. Is there a way to avoid the opening of a new window?

This is the HTML:
<html>

<head>
<meta http-equiv=&quot;content-type&quot; content=&quot;text/html;charset=iso-8859-1&quot;>
<meta name=&quot;generator&quot; content=&quot;Adobe GoLive 4&quot;>
</head>

<body>
<a name=&quot;up&quot;></a><a href=&quot;#anchor1&quot;>Press for Anchor1</a>
<p><a href=&quot;#anchor2&quot;>Press for Anchor2</a><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<a name=&quot;anchor1&quot;></a>Here is Anchor1<br>
<a href=&quot;#up&quot;>Back-UP</a>
<br>
<br>
<br>
<a name=&quot;anchor2&quot;></a>Here is Anchor2<br>
<a href=&quot;#up&quot;>Back-UP</a>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</body>

</html>

Kippie

 
Hi Ristmo,

I tried what you said, but Mail.com changes things! Your code <base target=&quot;_self&quot;> between the <head>-tags is changed by Mail.com into: <base >. I tried alrady several things:

I sent: <a href=&quot;#anchor3&quot; target=&quot;_self&quot;>Press for Anchor3</a><br><br>
and Mail.com changed it into:
<a target=&quot;_blank&quot; href=&quot;#anchor3&quot; >Press for Anchor3</a>

and I sent:
<a href=&quot;#anchor4&quot; target=&quot;_self&quot; onclick=&quot;self.location=this.href;return false&quot;>Press for Anchor4</a>
and Mail.com changed it into:
<a target=&quot;_blank&quot; href=&quot;#anchor4&quot; onFiltered=&quot;self.location=this.href;return false&quot;>Press for Anchor4</a>

Is there still hope?

Kippie
 
Try this (without the target):

<a href=&quot;#anchor4&quot; onclick=&quot;self.location=this.href;return false&quot;>Press for Anchor4</a>

Rick -----------------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top