Page anchors and titles

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

I have a page with several page anchors and links to them within it. Each time yhe link is clicked, and the position changes, the page title also changes. Rather than maintaining the original it changes to the filename.

I also have links to some of the anchors from other pages. In that case, the page title remains correct.

What I've done now to remedy the problem is added an onClick to the link image that resets the page title.

Is this generally how you solve the problem or is there a better/more correct way to do it?

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

What browser(s) are you getting this result in. It's not common. I suspect you are doing something funky to your coding in the first place.

Can we see the page(s) in question? That would be easier.

Smiling Suzanne

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

I'm using IE5. This problem does not occur on NS6. The page is being run locally.

Excerpt of the code I used:

<title>XYZ</title>

[...]

<a name='top'></a>

[...]

<!-- Normal -->
<a href='#top'><img src='top.gif' border='0'></a>

<!-- With JS title reset -->
<a href='#top'><img src='top.gif' onClick='document.title="XYZ"' border='0'></a>
'

Thanks.

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

It only happens locally as far as I can test. And only in IE.

Don't bother with the work arounds unless the page is only going to be viewed locally.

I took a page that works for me online ( zerocattle.com/info2.html ) , saved it to my harddrive (it's built with SSI, so I didn't have a local copy to play with) and duplicated your error in IE.It works fine online, only the first click works offline, then every other click gives just the file name.

It's obviously some IE bug/feature... (ha ha)

Smiling Suzanne

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

Unfortunately, this isn't being used locally. Sad

I've also noticed the problem in other websites online: the title changes to the URL of the file - even the zerocattle link you posted. :

So my guess is it's a problem with my particualr version of IE?

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Well I'll be damned, looks like it's a glitch in IE.

Figures.

What happens when you bookmark the page -- file name or page title?

What version of IE are you using? Has anyone else noticed this little mishap?

Smiling Suzanne

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.