Link to home
Start Free TrialLog in
Avatar of dehfne
dehfne

asked on

anchor link w/ query string not working in ie

i need to add an anchor link to the end of a url with a query string

research tells me it should look like this:
http://url?id=querystring#anchor

in my code it looks like this:
#cgi.scriptname#?#cgi.querystring###anchor

the code seems to be working fine, since the url reads fine in the address bar.  but it doesn't move to the anchor.  

here's what i know:
* this only seems to be a problem in ie.  works fine in mozilla and netscape
* if i type the url into the address bar, the anchor does work
* the anchor is far enough down the page to cause it to scroll down, since if i type it in, it works (see above)

any ideas why this wouldn't work???

thanks!




Avatar of pinaldave
pinaldave
Flag of India image

Hi dehfne,
cover that with <cfoutput></cfoutput> in yoru code it shoudl work then after.


Regards,
---Pinal
Hi dehfne,
sorry for previous mail. you must be using <cfoutput> that should not be the reason.
Can you just try to put with ### (three) pounds and see what it says. I know other expert will critize this but just for try and let us know what it says.

Regards,
---Pinal
Avatar of dehfne
dehfne

ASKER

the problem isn't with the code.  as i said in my post, the url reads fine in the in the browser address bar.

to be more clear:

(1) if i open the page, the url is:

http://mysite.com/page.cfm?querystring

(2) if i click on the link with the anchor, the url is:

http://mysite.com/page.cfm?querystring#anchor

yet it does not jump to the anchor.

(3) if i open the page (where the url is http://mysite.com/page.cfm?querystring) and type in #anchor at the end (so the url is http://mysite.com/page.cfm?querystring#anchor) and then press return. it does jump to the anchor.

any clues?  perhaps i posted in the wrong forum.  wasn't sure where else to put it.

thanks.
Avatar of dehfne

ASKER

oh sorry.  i replied the the first comment while you were replying again...

if i use three ### then it believes there is an extra # and chokes.  as it should.  
SOLUTION
Avatar of pinaldave
pinaldave
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dehfne

ASKER

i don't want to have to refresh the page b/c i might losing some information that was posted to it.  but i'll try and see what happens.  thanks.
Do you have the anchor defined in the page?

<a name="anchorvalue"></a>

Otherwise this will not work.

Also how are you getting to the page a link? a cflocation?  Can you post the code?

yeah a look at teh code shld help us figure out what cld be wrong ...
Avatar of dehfne

ASKER

i bascially did post the code.  but here it is again.

here's the anchor
<a name="top">&nbsp;</a>

here's the link
<a href="#cgi.SCRIPT_NAME#?#cgi.querystring###top">link</a>

as i said in my above post, the anchor *does work* if i merely add #top to the end of the url in the address bar.  it *does not* work if i click on the link.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dehfne

ASKER

please don't tell me that it "has to" work when it doesn't and you haven't even tried it.  it does look exactly the same, and this is why i'm posting here.  i think perhaps its a bug in ie.

i guess i posted to the wrong list.  thanks you all for trying, and i'll let you know if i find anything else out.
Here's the problem.

We have tried it.  And it did work for us.  You only gave us a generic link.  If you want us to test your actual page then you need to post the URL and we will check it out.

ALso have you tried using another machine?

Is there enough content BELOW the anchor?

We cannot answer any of these questions because we do not have your actual site.

It is not a bug in IE since it works for all of us.

It may be a bug in your code, but again - without an actual link to test we cannot say for sure.

All the tests we have run with the code you gave DO work in IE and other browsers.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dehfne

ASKER

i can't seem to get this to work, so i'm giving up.  i can't post the link, since you need an account and i can't give them out.  perhaps that would have helped i don't know...

since no one really was able to help me, but many of you tried, i split the points between the most viable answers.

thanks!