5 ms·
Can somebody explain to non-web-types why this matters, other than making the URL itself look cleaner?
by kylemaxwell 15y ago
Can somebody explain to non-web-types why this matters, other than making the URL itself look cleaner?
- mbreese 15y agoThe fundamental problem is that when you use hashbangs, if you want the page "/#!12345" the server gets: GET / HTTP/1.1 And never knows what content the client is trying to access, until the client retrieves and processes client-side javascript. Then the client can request further information from the server. The theory is that you can make a "single-page" web-app that loads all of the javascript at once. Then went state needs to be updated, you can do it all from javascript. In practice, it didn't work as well.
- alexmuller 15y agoAnd to expand a little on what mbreese said, the basic, fundamental idea behind the URL is for a client to indicate to a server what resource it's trying to access. So it's totally broken by that #!. http://isolani.co.uk/blog/javascript/BreakingTheWebWithHashBangs http://isolani.co.uk/blog/javascript/BreakingTheWebWithHashB... is a great article.
- ceol 15y agoIt was hinted at in other comments, but when you go to http://twitter.com/#!/danwrong http://twitter.com/#!/danwrong, what you're really doing is going to http://twitter.com/ http://twitter.com/, processing a chunk of JavaScript that looks at what's after the #!, then loading up danwrong's page. This causes issues with search engines (the server has already told the crawler everything's OK, so how do you tell it the page can't be found?) and changing URLs (if you want to stop using hashbangs, you have to include an annoying piece of JavaScript on your home page forever). So now, Twitter wants to get rid of the hashbang from its URLs because of— in part— the first reason, and it's currently dealing with the second. Hope that explained a bit.
- kylemaxwell 15y agoThanks, that's what I didn't get: the stuff after the hashbang isn't sent directly to the server as part of the GET request but interpreted by JavaScript after the page starts to load.
- x3c 15y agoActually, twitter should not have any google indexing problem. Search engines have provided new scheme for indexing hashbang URLs with Ajax content[1]. But, maybe, not all search engines have implemented it yet. If I had to guess, primary reason would be that server is blind as to what page needs to be loaded when you click twitter.com/#!something and an ajax request actually serves the relevant content, so it's relatively slower. Twitter's implementation was particularly slower. [1]https://developers.google.com/webmasters/ajax-crawling/docs/getting-started https://developers.google.com/webmasters/ajax-crawling/docs/...
- bad_user 15y agoSearch engines have provided new scheme for indexing hashbang URLs with Ajax content[1]. This is a myth. First of all there is no standard and Google has no way of knowing if a website's implementation of hashbang URLs behaves in the expected manner, or not. Then, you've got all those other issues ... with hashbangs you have no standard way of telling Google some content moved (302, 303) or is not available anymore (404). Therefore they have to make tweaks for individual websites (akin to how Microsoft was pushing "special" fixes for various popular software running on Windows that broke on updates). Telling people that hashbang URLs are indexed is exactly the same as telling them that Flash content is indexed ... sure it is. But unless you're too popular for Google to ignore, then get ready for a world of pain.
- EdiX 15y agoThis is a myth. First of all there is no standard and Google has no way of knowing if a website's implementation of hashbang URLs behaves in the expected manner, or not. https://developers.google.com/webmasters/ajax-crawling/docs/specification https://developers.google.com/webmasters/ajax-crawling/docs/... However you are probably right on everything else.
- jordhy 15y agoSeveral issues: back button programability, URIs become uglier so then you need to do some parsing, etc. The sample the pros and cons of hashbangs, refer to the discussion on this page: http://ask.metafilter.com/187222/Whats-wrong-with-using-hashbangs-in-URLs http://ask.metafilter.com/187222/Whats-wrong-with-using-hash...