On my website when running through it on certain windows open up in a new Internet Explorer window. Does anyone know why this happens? It's just like all the other HTMLs on the website.
I appreciate any help. :rolleyes:
On my website when running through it on certain windows open up in a new Internet Explorer window. Does anyone know why this happens? It's just like all the other HTMLs on the website.
I appreciate any help. :rolleyes:
Extra context and a few practical fixes that build on ’s diagnosis.
Why it opened new windows: any target value that is not one of the reserved keywords (_self, _blank, _parent, _top) is treated as a window/frame name. If no frame exists with that name the browser will create (or reuse) a window with that name — which looks exactly like “a new Internet Explorer window.” That also explains why repeated clicks can open or reuse a second window instead of navigating in the same tab. Map editors (like the MapEdit mentioned by ) commonly insert named target values automatically.
Quick cleanup checklist
target= (editor “Find in files”, grep, or PowerShell/findstr). target attributes or change them to _self if you want the same window. Back up files before doing bulk changes. onMouseOver/onClick attributes that contain plain text — those should be real JS handlers or simply replaced with title/aria-label for tooltips and accessibility. Image maps are harder to maintain and less accessible; if possible replace them with semantic links or responsive markup.Safe automated remove (example — test on copies first):
Find (regex):
\s*target=(?:"[^"]*"|'[^']*') Replace with: (leave blank)
If you do intentionally want a new tab/window, use _blank and add the security attribute:
<a href="page.html" target="_blank" rel="noopener noreferrer">Open page</a> Verify: use your browser’s inspector to confirm the attribute is gone, and run the page through the W3C Validator. Small changes — removing the stray target values and cleaning up MapEdit’s extras — will fix the behavior and make the markup more robust.
Jump to Post— DaveSW 15Do you have the url available so we can take a look for ourselves?
Jump to Post— DaveSW 15In the source code of this page:
There is a target attribute in your image map on the tri-fold brochure.Open the page in notepad, (open notepad then go file -> open, or right click and open with from the explorer window)
…
Jump to Post— DaveSW 15also on the second line you are missing a '>'.
<html> <head>
Jump to Post— tgreer 189Please use the forum's code tags when posting code samples!
Do you have the url available so we can take a look for ourselves?
Yes it is
Thanks
In the source code of this page:
There is a target attribute in your image map on the tri-fold brochure.
Open the page in notepad, (open notepad then go file -> open, or right click and open with from the explorer window)
Then delete the bit I've bolded.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html <head>
<title>Portfolio</title>
</head>
<body bgcolor="#0033FF" TEXT="white" LINK="white" VLINK="white">
<div align="center"><font face="arial">
<b><a href="index.html">Home</a>
</b>
<br><br>
<img src="portfolio.gif" usemap="#portfolio" style="border-style:none">
</div>
<div>
<map id="portfolio" name="portfolio">
<area shape="rect" alt="" coords="164,143,517,191" href="trifold.html" title="" target="Tri-Fold Brochure" onMouseOver="Tri-Fold Brochure" onMouseOut="Tri-Fold Brochure" onClick="Tri-Fold Brochure" />
<area shape="rect" alt="Business Cards" coords="168,58,483,105" href="buscard.html" title="Business Cards" onMouseOver="Business Cards" onMouseOut="Business Cards" onClick="Business Cards" />
<area shape="rect" alt="Marketing Brochure" coords="167,105,532,139" href="slide1.html" title="Marketing Brochure" onMouseOver="Marketing Brochure" onMouseOut="Marketing Brochure" onClick="Marketing Brochure" />
<area shape="rect" alt="Knights of Columbus" coords="164,191,517,231" href="kofc.html" title="Knights of Columbus" onMouseOver="Knights of Columbus" onMouseOut="Knights of Columbus" onClick="Knights of Columbus" />
<area shape="default" nohref="nohref" alt="" />
</map>
</div>
</body>
</html>
Alternatively you could open it with whatever you used to create the file, and delete whatever is in the target attribute from there.
The target attribute is used with framests, to open a link in another frame.
Are there any other specific links that you have a problem with?
also on the second line you are missing a '>'.
<html> <head>
Nope. Thank you so much, this fixed my problem. I appreciate it!
Please use the forum's code tags when posting code samples!
and then will it accept the part I need bolded?
Yes. You can apply color and other formatting, even within code blocks.
Okay I also have a problem with the Business card web page when you click on TMD Construction' business card it opens a new window also and there is no "target" in the code.
Thanks,
Taking the last few lines of your page:
<map id="buscardtj" name="buscardtj">
<area shape="rect" alt="" coords="1,5,223,359" href="tjs.htm" title="" target="TJ's Business Card" onMouseOver="TJ's Business Card" onMouseOut="TJ's Business Card" onClick="TJ's Business Card" />
<area shape="default" nohref="nohref" alt="" />
</map>
</div>
</body>
</html> There's a target in there!
Can I suggest using ordinary hyperlinks instead of image maps?
Just replace
<map id="buscardtj" name="buscardtj">
<area shape="rect" alt="" coords="1,5,223,359" href="tjs.htm" title="" [b]target="TJ's Business Card"[/b] onMouseOver="TJ's Business Card" onMouseOut="TJ's Business Card" onClick="TJ's Business Card" />
<area shape="default" nohref="nohref" alt="" />
</map> and
<td align="center"><img src="buscardtj.gif" height="362" width="225" usemap="#buscardtj" style="border-style:none"></td> with
<td align="center"><a href="tjs.htm"><img src="buscardtj.gif" height="362" width="225" alt="tj's business card" style="border:none"></a></td> It's shorter to code, and easier to see what's wrong with it.
Also you could replace the style tag in each one with a single declaration in your head section.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Business Cards</title>
<style type="text/css"><!--
body { background: #0033ff; color: #ffffff; font-family: arial, sans-serif; font-size: 125%; text-align: center; }
h1 { font-size: 150% }
a { color: white; font-weight: bold; }
a:hover { color: #99ccff; }
td img { border: none; }
td { text-align: center; vertical-align:middle; }
--></style>
</head>
<body>
<div><h1>Business Card Design Services</h1>
<a href="index.html">Home</a>
<a href="port.html">Portfolio</a></div>
<div><i>Click on a business card for a larger view</i></div>
<table>
<tr>
<td><a href="anns.htm"><img src="newbuscard2.jpg" height="203" width="355" alt="Ann's Business Card"></a></td>
<td><a href="freds.htm"><img src="SSLogo2.jpg" height="201" width="302" alt="Fred's Business Card"></a></td>
</tr>
<tr>
<td><a href="dads.htm"><img src="aebuscard.jpg" height="203" width="355" alt="John's Business Card"></a></td>
<td><a href="tjs.htm"><img src="buscardtj.gif" height="362" width="225" alt="TJ's Business Card"></td>
</tr>
</table>
</body>
</html> Yes. You can apply color and other formatting, even within code blocks.
How exactly? I just tried the BB tags and it printed them as they were.
<td>[B]Bold bit in here[/B] </td> Thank you very much for your support, I really appreciate it.
I used a program called "MapEdit" which is very simple to use but obviously puts targets in there that I don't see, and alos makes the code much longer.
Anytime ;)
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.