Click here to Skip to main content
Sign Up to vote bad
good
See more: Ajaxurlhash
how I can get my application to work like that gmail adding and reading the # in the url
Help please
Posted 13 Nov '12 - 14:06

Comments
Sergey Alexandrovich Kryukov - 13 Nov '12 - 20:11
Not clear at all. --SA
David Cabrea - 13 Nov '12 - 20:54
I have noticed that gmail and facebook add # in the url eg https://mail.google.com/mail/u/0/#inbox and when I select another label change only the part that follows the # Thus when I press back again to the previous url. This is the style that I would be interested to know how to apply in my web application thank you

1 solution

This is nothing but standard URI "fragment identifier": http://en.wikipedia.org/wiki/Fragment_identifier[^].
 
So, there is nothing specific to gmail or facebook. One little twist is the combination with the index file naming schema, which creates the URLs of the form "https://mail.google.com/mail/u/0/#inbox". The part before "#inbox" can be creates as a directory on the file systems mapped to a site with a server, with some file named like "index.html", "index.htm" or the like. Actually, it can be any file name matching some wildcard-based naming schema prescribed in the HTTP server options. In this case, "#inbox" merely addresses some fragment location within this file, nothing special.
 
See also: http://en.wikipedia.org/wiki/URL[^].
 
That would be all, but…
 
At the same time, I must admit that the interpretation of the URL part after the domain or domain:port part (see the above article), could be completely custom and not related to actual file structure on the host of the server. There is a number of techniques supporting URLs not directly mapped to the file system. Some of such techniques are actually pretty much standard. To get in idea, you can learn about URL rewriting, URL mapping and URL routing (!):
http://en.wikipedia.org/wiki/URL_rewriting[^],
http://msdn.microsoft.com/en-us/library/ms972974.aspx[^],
http://en.wikipedia.org/wiki/URL_mapping#URL_mapping[^],
http://support.microsoft.com/kb/976111[^].
 
There are some techniques related to particular server-side scripting models, such as WSGI created just for Python:
http://en.wikipedia.org/wiki/Web_Server_Gateway_Interface[^].
 
Probably there are some other approaches. After all, nothing prevents you from creating your own HTTP server (and even from available components) and create your own mechanism for mapping the URIs. From the client side, you cannot really know what's going on.
 
—SA
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 OriginalGriff 266
1 Mohammed Hameed 183
2 Sergey Alexandrovich Kryukov 143
3 Santhosh G_ 108
4 CPallini 96
0 Sergey Alexandrovich Kryukov 8,266
1 OriginalGriff 6,306
2 CPallini 3,528
3 Rohan Leuva 2,703
4 Maciej Los 2,234


Advertise | Privacy | Mobile
Web04 | 2.6.130516.1 | Last Updated 14 Nov 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid