#网址gmail样式 [英] # In url gmail style

查看:142
本文介绍了#网址gmail样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何使我的应用程序像gmail一样工作,并在url中添加和读取#
请帮忙

how I can get my application to work like that gmail adding and reading the # in the url
Help please

推荐答案

这不过是标准URI"片段标识符": ^ ].

因此,没有特定于gmail或facebook的内容.与索引文件命名架构的结合是一个小小的转折,它创建了格式为"https://mail.google.com/mail/u/0/#inbox"的URL.可以将"#inbox"之前的部分创建为文件系统上的目录,该文件系统映射到使用服务器映射到站点的站点,其中包含一些名为"index.html","index.htm"等的文件.实际上,它可以是与HTTP服务器选项中指定的某些基于通配符的命名模式匹配的任何文件名.在这种情况下,#inbox"仅解决该文件中的某些片段位置,没什么特别的.

另请参见: http://en.wikipedia.org/wiki/URL [ 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 [ http://en.wikipedia.org/wiki/Web_Server_Gateway_Interface [
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


这篇关于#网址gmail样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆