/    Sign up×
Community /Pin to ProfileBookmark

Anchors not working in IE

Anchors not working in IE.

Are anchors considered javascripts?

to post a comment
HTML

36 Comments(s)

Copy linkTweet thisAlerts:
@keith28authorMar 28.2005 — My anchors work in all browsers except IE Windows

Can anyone help?

[upl-file uuid=e42b617b-d181-4fd8-a3bb-5d4a9d62896b size=68kB]test.zip[/upl-file]
Copy linkTweet thisAlerts:
@JPnycMar 28.2005 — No, they are HTML. I will move this to the HTML forum, where you're more likely to get a useful response.
Copy linkTweet thisAlerts:
@rhsundergroundMar 28.2005 — how do you mean, they do not work? they work on my computer.
Copy linkTweet thisAlerts:
@keith28authorMar 28.2005 — I just realized i uploaded the wrong files.

Give me a minute to upload the others.
Copy linkTweet thisAlerts:
@keith28authorMar 28.2005 — OK here it is

sorry about that.

does this work?

[upl-file uuid=9dff3a7e-166e-41c1-ba2d-b835cdfbac51 size=3kB]pe.html.zip[/upl-file]
Copy linkTweet thisAlerts:
@BonRougeMar 28.2005 — What exactly do you think the problem is?
Copy linkTweet thisAlerts:
@rhsundergroundMar 28.2005 — well first off, tables are bad for layout, but i'm not gonna go into that.


try replacing

[code=php]<div align="right">
<img src="../images/tips/4.jpg" alt="" width="25" height="25" border="0">
<a id="anchor4" name="anchor4"></a></div>[/code]


with

[code=php]<div align="right"><a id="anchor4" name="anchor4"></a>
<img src="../images/tips/4.jpg" alt="" width="25" height="25" border="0" /></div>
[/code]
Copy linkTweet thisAlerts:
@keith28authorMar 28.2005 — that did not work.

it's the same thing just swapped.
Copy linkTweet thisAlerts:
@rhsundergroundMar 28.2005 — on my computer it worked when the code was rearranged. did you make the change in the image tag as well? (img src="blah.jpg" />)
Copy linkTweet thisAlerts:
@keith28authorMar 28.2005 — Why is IE such a pain? all the other browsers I did not have to fuss like this.
Copy linkTweet thisAlerts:
@rhsundergroundMar 28.2005 — i've attached the full code i used that worked in IE 6

[upl-file uuid=c23e2a6b-6875-4007-b026-99505a5c2998 size=13kB]dddd.txt[/upl-file]
Copy linkTweet thisAlerts:
@keith28authorMar 28.2005 — are you working on a windows machine?
Copy linkTweet thisAlerts:
@ray326Mar 28.2005 — From
&lt;div align="right"&gt;
&lt;img src="../images/tips/4.jpg" alt="" width="25" height="25" border="0"&gt;
&lt;a id="anchor4" name="anchor4"&gt;&lt;/a&gt;&lt;/div&gt;

To
&lt;div align="right"&gt;
&lt;a id="anchor4" name="anchor4"&gt;&lt;img src="../images/tips/4.jpg" alt="" width="25" height="25" border="0"&gt;
&lt;/a&gt;&lt;/div&gt;

"An anchor wrapping nothing, clicked it cannot be." - Yoda
Copy linkTweet thisAlerts:
@David_HarrisonMar 28.2005 — "An anchor wrapping nothing, clicked it cannot be." - Yoda[/QUOTE]I don't think it's meant to be clicked on.

Try this:[code=html]<img src="../images/tips/4.jpg" alt="Alternate text should never be left blank." width="25" height="25" style="border:0;float:left;" id="anchor4">

<a href="#anchor4">Jump to the image.</a>[/code]
Copy linkTweet thisAlerts:
@ray326Mar 28.2005 — Ah so. IC. But the following from the spec indicates wrappage is still necessary.

Suppose we define an anchor named "anchor-one" in the file "one.html".

...text before the anchor...

<A name="anchor-one">This is the location of anchor one.</A>

...text after the anchor...

This creates an anchor around the text "This is the location of anchor one.". Usually, the contents of A are not rendered in any special way when A defines an anchor only.
[/quote]
Copy linkTweet thisAlerts:
@felgallMar 28.2005 — An anchor wrapping nothing, clicked it cannot be." - Yoda[/QUOTE]

Anchors are not supposed to be clicked, they are the target of a link from elsewhere. You click on links - not anchors.

&lt;a name="dest" id="dest"&gt;&lt;/a&gt;

&lt;a href="#dest"&gt;link to dest&lt;/a&gt;


The first line of code is the anchor and the second is the link to it.
Copy linkTweet thisAlerts:
@keith28authorMar 28.2005 — it's not working in IE windows.
Copy linkTweet thisAlerts:
@keith28authorMar 28.2005 — So you think the name of the achors are the problem?

why would that be?
Copy linkTweet thisAlerts:
@keith28authorMar 28.2005 — I just tried that. Same problem does no work.

Is anyone looking at the file I uploaded and test it?
Copy linkTweet thisAlerts:
@rhsundergroundMar 28.2005 — I just tried that. Same problem does no work.

Is anyone looking at the file I uploaded and test it?[/QUOTE]

i opened, made the changes that were in the file i attached, and it worked fine in IE6, windows XP.
Copy linkTweet thisAlerts:
@keith28authorMar 28.2005 — I dont see any file that you attached.

Can you attach it again?
Copy linkTweet thisAlerts:
@rhsundergroundMar 28.2005 — [URL=http://www.webdeveloper.com/forum/attachment.php?attachmentid=4809]attached file[/URL]
Copy linkTweet thisAlerts:
@keith28authorMar 28.2005 — why are you sending this stuff as TXT???

The text does not work

send the html
Copy linkTweet thisAlerts:
@David_HarrisonMar 28.2005 — why are you sending this stuff as TXT???

The text does not work

send the html[/QUOTE]
Try uploading a .html file.
Copy linkTweet thisAlerts:
@keith28authorMar 28.2005 — This is the third time uploading the file.

[upl-file uuid=15f095b2-d8f8-4855-80a4-b6ecc002d27e size=4kB]photo-explorer.html.zip[/upl-file]
Copy linkTweet thisAlerts:
@rhsundergroundMar 28.2005 — on your own computer, open the .txt file and save it as "yourfilename.txt" and it will be fine.
Copy linkTweet thisAlerts:
@keith28authorMar 28.2005 — txt and html are not the same

I renamed it and everything.

Why do i feeling like this is such a simple thing and is has become so frustrating?

Are their any html Guru's out there?
Copy linkTweet thisAlerts:
@rhsundergroundMar 28.2005 — i can't understand why it isn't working for you.

try this working example:http://skinneralamod.com/test/testpage1.html
Copy linkTweet thisAlerts:
@ScleppelMar 28.2005 — I think what he ment was save it on your computer as a .html file. Just copy everything from the txt file into notepad (or whatever) and save it as .html
Copy linkTweet thisAlerts:
@rhsundergroundMar 28.2005 — I think what he ment was save it on your computer as a .html file. Just copy everything from the txt file into notepad (or whatever) and save it as .html[/QUOTE]
that's it. sorry if i didn't make myself clear.
Copy linkTweet thisAlerts:
@keith28authorMar 29.2005 — hi, I clicked your link. But page could not be found.

Do you still have the page up?
Copy linkTweet thisAlerts:
@ray326Mar 30.2005 — Anchors are not supposed to be clicked, they are the target of a link from elsewhere. You click on links - not anchors.

&lt;a name="dest" id="dest"&gt;&lt;/a&gt;

&lt;a href="#dest"&gt;link to dest&lt;/a&gt;


The first line of code is the anchor and the second is the link to it.[/QUOTE]

Regardless, the quote I posted was from the spec and it indicated anchors probably need to be wrapping something, just like links do.
Copy linkTweet thisAlerts:
@rhsundergroundMar 30.2005 — the page is still there, but there is one flaw.

Regardless, the quote I posted was from the spec and it indicated anchors probably need to be wrapping something, just like links do.[/QUOTE]my code does not follow this standard, but that can be easily changed however you want it.
Copy linkTweet thisAlerts:
@David_HarrisonMar 30.2005 — You don't need to bother with <a name="whatever"></a> because you can just apply an ID to something and then link to that, just like the code I posted before which works in all browsers that support the id attribute.[code=html]<img src="../images/tips/4.jpg" alt="Alternate text should never be left blank." width="25" height="25" style="border:0;float:left;" id="anchor4">

<a href="#anchor4">Jump to the image.</a>[/code]
If you want an online example the go to my site, it uses anchors all over the place. [url=http://www.quiterude.com/comment.asp?blog=21#post14]Random link[/url].
Copy linkTweet thisAlerts:
@keith28authorMar 31.2005 — Have a look at this

[upl-file uuid=714727aa-89d1-4793-8f93-ccdb33f12728 size=70kB]test.zip[/upl-file]
Copy linkTweet thisAlerts:
@David_HarrisonApr 01.2005 — Well the only link to an anchor on the same page is this one:&lt;a href="#anchor4"&gt;Jump to the image.&lt;/a&gt;And the anchor in question is this one:&lt;a id="anchor4" name="anchor4"&gt;&lt;/a&gt;And it works. So what's your point?

Edit: Ah, it doesn't work in IE. That's because you have two elements with the same ID.

Here's the other element with the same ID:&lt;img src="../images/tips/4.jpg" alt="Alternate text should never be left blank." width="25" height="25" style="border:0;float:left;" id="anchor4"&gt;By the way, alternate text is supposed to be useful, in the event of the image not showing up, the alternate text will be displayed instead.
×

Success!

Help @keith28 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...