[Gllug] OT: specifying anchors and cgi parameters in a single URI

Ryan Cartwright ryan at crimperman.org
Fri Feb 24 15:27:31 UTC 2006


Anthony Newman wrote:
> Ryan Cartwright wrote:
> 
>>
>> These URIs containing parameters and anchors work in IE (6 and below) 
>> but not in Moziall,Firefox, Konqueror or Opera. Any ideas on what I 
>> can do to enable the same functionality cross-browser?
>>
> 
> I must be missing something, because as I see it; if the URI refers to a 
> specific location on another page, then giving the full URI as a link 
> target is fine. If the anchor is on the same page (as I suspect from the 
> Ctrl-F mentioned) then what is wrong with stripping off everything 
> preceding the "#foo" and using that as the target?
> 
> Confused of Holborn

Sorry I should have said the actual href is "#foo" as you suggest but 
the browsers in question append this to the current URI when clicked. 
trying to load a page with the resultant URI of
http://www.foo.com/script.cgi?p=1&r=2#foo. This is indicated by the 
status bar text shown when hovering over the link.

Somebody at at c.i.w.a.h suggested the # should be encoded but this 
creates two problems. An href pf "%23foo" is not passed by the browser 
as a local anchor - it is instead passed as http://www.foo.com/#foo .
Giving the entire URI in the link to the anchor ( 
http://www.foo.com/script.cgi?p=1&r=2%23foo ) ends up with the browser 
passing 2%23foo as the value for the last parameter.
Encoding the # using # just gives the same result as using a plain 
# character.

thanks anyway
Ryan


-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list