3 ms·
I think people are missing a huge benefit of the hashbang syntax: readable and copy/paste-able URLs. Without them, it's impossible to have an ajax application w
by zaius 16y ago
I think people are missing a huge benefit of the hashbang syntax: readable and copy/paste-able URLs. Without them, it's impossible to have an ajax application with a decent URL scheme.
- jamesjyu 16y agoI think the real question here is whether the application should be loading the main content via AJAX in the first place. Tim argues here that it should not, for this use case.
- zaius 16y agoThen that's what the article should say, instead of hating on the hashbang syntax, which is currently the best solution to the problem. I also don't see why these web pages (specifically twitter) shouldn't be an ajax application - I think loading a page statically, and then the data via ajax is a Good Thing™.
- masklinn 16y agoYou don't need the hashbang for that. You never did. Hashbang only tells google "munge around this shit to get an actual page".
- robin_reala 16y agoWhat the hashbang does is update the URI in such a way that it’s possible to bookmark/share a URI (assuming you’ve coded your app properly). It is however just a stopgap measure until pushstate turns up - that way we’ll be able to have URIs that encode the document/state reference in the proper part, not the fragment. Actually, you are right with regards to the bang pash of hashbang - that’s just a Google defined way of letting them access the content.
- zaius 16y agoI'm curious what the other solutions are then. The only one I can think of is the History.pushState, and that's only supported in newer browsers. Let's say I'm writing a web based word processor, and a user clicks on a document. I want the URL to be a reference to that specific document. The only way to change the URL to be specific without requiring a whole-page refresh is to use the hashbang syntax.
- tjpick 16y agowell it looks like they are emitting crap like this <a rel="nofollow" href="/#!about/" title="Click here to go to About">About</a> without the hashbang shit, that's a nice normal link that any normal http client can work with. you can still layer on ajax to bind to that link, and use the fragment for the benefit of browser state and user interaction should you think that is a wise thing.
- masklinn 16y ago> I'm curious what the other solutions are then. The hash without the bang. It's only been done for about 10 years. You can put whatever you want after the hash. It's up to your application to decide the meaning of it. For an example, see the OSX SDK documentations: http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html http://developer.apple.com/library/mac/#documentation/Cocoa/...