anchor link problem

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
php_ghost
Forum Commoner
Posts: 55
Joined: Thu Jan 11, 2007 3:29 am

anchor link problem

Post by php_ghost »

Hi i'm experiencing some problems with anchor links. The link does not always work. If it did not work, I have to refresh the page for it to scroll to the anchor name.
Any ideas how to resolve this issue?

here's the code for the anchor name:

Code: Select all

<a name="top_image"><img src="image_url"></a>
here's the code for the link:

Code: Select all

<a href="how_it_works.php?step=1#top_image">link</a>
TIA
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Post by califdon »

My first guess would be that the browser is caching the page, so it returns to the last scroll position. You might try including a no-cache meta http-equivalent tag at the beginning of the page. http://www.pacificnet.net/~johnr/meta.html
php_ghost
Forum Commoner
Posts: 55
Joined: Thu Jan 11, 2007 3:29 am

Post by php_ghost »

it still doesn't work. :cry:

wether it will work or not, is very random. :cry:
User avatar
nykoelle
Forum Newbie
Posts: 22
Joined: Fri Aug 10, 2007 9:05 am
Location: New York

Post by nykoelle »

Try just using the href as the anchor reference.

Code: Select all

<a href="#top_image"><img src="image.jpg" alt="Image" /></a>
also make sure you close your image tag, don't know what affect that has in the rendering of the code, but since you're having problems best to just get everything fixed.

If that fixes it, then figure out some other way to pass the variable to php.
Post Reply