Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

As far as I know, there's no way to get url hash in a server side language since hash urls are not being sent to the server side. One of my co-workers told me that it should be possible in java (jsp) or Ruby. Since I tested it on PHP, but it simply doesn't work. I googled about ruby and jsp, but had no luck. He also mentioned that the first access (http://domain.com/index.php#test ) is accessible from a server side.

in PHP, printing our $_SERVER variable doesn't have anything about hash

Is this really possible in other server side languages?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
744 views
Welcome To Ask or Share your Answers For Others

1 Answer

Short answer: no, it's a client side only thing.

Slightly longer: It's called Fragment identifier and is client side only - browser doesn't send that part of the url to the server. It's not possible in any language unless you are using some browser implementation (or software) which would send that part of url to the server. Reference: http://en.wikipedia.org/wiki/Fragment_identifier


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...