Forum Moderators: open

Message Too Old, No Replies

anchor & querystings not working

         

ice70

7:08 pm on Mar 16, 2007 (gmt 0)

10+ Year Member



Hi there
I have a page, that apparently I am not allowed to tell you about due to T&C's, which means showing the bug is going to be a bit tricky....

apage.html

there is a series of links at the bottom, previous / numbers / next which reloads the page to pull in a new image through the query string. There is also an anchor on the link, for example:

apage.html?main_img=929#cms_ig_mi

the anchor is:
<a name="cms_ig_mi" id="cms_ig_mi" shape="rect"></a>

It is generated through backend code, which is why the shape="rect" is in there - but I have tried it hard coded it into the page and disabled the generated version with the same results.

The problem happens in both Firefox 2 and IE 7. Click on the links and sometimes the page scrolls down to the anchor point, sometimes not. reload the page and it normally goes down to the anchor point.

The page html validates through firefox / tiny.

If i take out the querystring, the page loads and scrolls down to the anchor no problem, but then no further images can be viewed....

Is there something about a querystring with an anchor that causes intermittent failures?

Any suggestions would be gratefully received as this is driving me nuts!

Thank you
Callum

tedster

7:22 pm on Mar 16, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The browser will not scroll down to a named anchor until the page itself is completely downloaded. So I would first suspect that the server may be hanging up intermittently. HTML is not usually a "sometimes" thing - but each microsecond can mean a new server or database condition.

ice70

7:43 pm on Mar 16, 2007 (gmt 0)

10+ Year Member



hey there

ok, found another post somewhere else that explained the problem I was having - as the images were dynamically created, there was no height & width, so the page when initially loaded it did not have the image height so the length of the page was not sufficient to allow the anchor to move the page. On a subsequent load of the same page, it was quite likely the image was cached and so loaded in time for the page to be long enough to allow the page to move to the anchor point.... Hacked in the image height and width and it does seem to work ok... Guess the querystring was just a red herring!

Thank you for your reply
Callum

penders

1:01 pm on Mar 17, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It is generated through backend code......
......as the images were dynamically created, there was no height & width

Is it possible to work out what the width and height should be using your 'backend code' and apply the relevant html attributes when you serve your page?