Page 1 of 1

anchor link problem

Posted: Wed Aug 29, 2007 3:51 pm
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

Posted: Wed Aug 29, 2007 4:30 pm
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

Posted: Wed Aug 29, 2007 5:06 pm
by php_ghost
it still doesn't work. :cry:

wether it will work or not, is very random. :cry:

Posted: Thu Aug 30, 2007 7:56 am
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.