How to use '#'... |
[eluser]evolutionxbox[/eluser]
I have a page, with div elements with unique 'id' attributes. When I want to link to that specific section I would use a '#' in the anchor 'href' attribute. How can I get codeigniter to know what value comes after that '#'? ... Example: Code: <a href="#goto">Go to below</a> url = http://example.com/home#goto I want to get at the bit after the '#' (i.e. the goto bit).
[eluser]taewoo[/eluser]
That's a HASH... and this isn't a CI related question. It's an HTML question. PS: You need anchor name: Code: <a name="goto">Your #goto will scroll browser to here</a>
[eluser]evolutionxbox[/eluser]
The hash also works with id attributes, but my question remains to do with CI. Like uri_string(), how can I get the hash value from the uri (not a html question)?
[eluser]taewoo[/eluser]
not sure if uri string reports that. You can test but im pretty sure it doesn't... parse_url is your best bet
[eluser]evolutionxbox[/eluser]
I found that the hash value never gets passed to the server... whilst parse_url is a good idea it won't be able to parse anything. Ah well.
[eluser]taewoo[/eluser]
u can do it with Javascript... get the hash and pass via ajax or as form variable
|
Welcome Guest, Not a member yet? Register Sign In |