admin管理员组文章数量:1195563
how i can make my pages show like grooveshark pages
!/popular
is there a tutorial or something to know how to do this way for showing page by jQuery or JavaScript?
how i can make my pages show like grooveshark pages
http://grooveshark.com/#!/popular
is there a tutorial or something to know how to do this way for showing page by jQuery or JavaScript?
- 1 I added some tips to my answer that you may find useful if you want to create a site using this technique. – bigblind Commented Oct 13, 2012 at 8:27
1 Answer
Reset to default 28The hash and exclamation mark in a url are called a hashbang, and are usualy used in web applications where javascript is responsible for actually loading the page. Content after the hash is never sent to the server. So for example if you have the url example.com/#!recipes/bread
. In this case, the page at example.com would be fetched from the server, this could contain a piece of javascript. This script can then read from location.hash
, and load the page at /recipes/bread
.
Google also recognizes this URL scheme as an AJAX url, and will try to fetch the content from the server, as it would be rendered by your javascript. If you're planning to make a site using this technique, take a look at google's AJAX crawling documentation for webmasters. Also keep in mind that you should not rely on javascript being enabled, as Gawker learned the hard way.
The hashbang is being going out of use in a lot of sites, evenif javascript does the routing. This is possible because all major browsers support the history API. To do this, they make every path on the site return the same Javascript, which then looks at the actual url to load in content. When the user clicks a link, Javascript intercepts the click event, and uses the History API to push a new page onto the browser history, and then loads the new content.
本文标签: javascript hashtag and exclamation mark in links as folderStack Overflow
版权声明:本文标题:javascript - #! hashtag and exclamation mark in links as folder? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738512767a2090907.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论