22 ms·
Using a # to show JS state changes in the URL isn't some huge developer cock-up like it's being portrayed to be, it's just making the best user experience out o
by udp 16y ago
Using a # to show JS state changes in the URL isn't some huge developer cock-up like it's being portrayed to be, it's just making the best user experience out of the functionality available - see this for instance: http://code.google.com/p/reallysimplehistory/ http://code.google.com/p/reallysimplehistory/
HTML5 provides the new history.push system, which provides all the functionality hashbangs are being used for without the hashbangs: http://www.kylescholz.com/blog/2010/04/html5_history_is_the_future.html http://www.kylescholz.com/blog/2010/04/html5_history_is_the_.... The fact that a new feature has been added for it goes to show that it's something necessary - Facebook, for instance, uses history.push if present, and falls back on hashbangs when it isn't.
It's often a very important thing to be able to do, else if you have (for example) multiple tabs or other frontend navigation for your web-app, pressing back would have to take you right out of the application, rather than back to the last place you were.
- T-hawk 16y agoIt seems that much of this consternation about munged URLs (here and in other threads) is about preserving the functionality of the "back" button. Why do we need a back button? The DOS and Unix command lines never had a back button. Lotus 1-2-3 and WordStar and Word and Excel never had a back button. Photoshop and GIMP never had a back button. SQL scripts and database servers never had a back button. Many of these programs do have application-specific implementations of an "undo" function. Perhaps that is the way to go for future software, rather than trying to wedge a universal "back" function into applications that don't really map to that paradigm? What does "back" even mean when the application is a game, for example? Flight Simulator and Ultima and Doom never had back buttons.
- simonw 16y agoIt's nothing to do with the back button. It's about addressability - being able to link to things. Links are kind of important on the Web.
- udp 16y agoIt's all about the back button in a web-app when addressability doesn't matter. The user doesn't expect to be logged out when they click back out of force of habit.
- deleted 16y ago[deleted]
- Isofarro 16y agoSo many issues with such a short comment! * If the back button behaviour is important, perhaps not breaking it in the first place is an appropriate approach * The addressability of resources is one third of the fundamental basis of the Web. Ignoring it is essentially non-web, so I suggest the label "web-app" is incorrect. * The user-expectation of clicking the back button but expecting to remain on your one-page website sounds like a usability problem brought about by applying a non-web-like interface inside a web browser. Perhaps a better user-experience is not breaking the well-understood web-navigation model, and thus not be confusing to the user. Or perhaps these "web-apps" need to make it clear to the user that they deliberately don't follow the characteristics of a web resource?
- udp 16y agoLet's take a look at the alternatives to breaking the back button, then: - The web application could serve static pages and then update them with AJAX What if the user clicks back /then/? All the AJAX updates would be lost, and they'd go back to an older version of the page - they'd then see the data on the page "jump" to the updated version. - The web application could not use AJAX at all, and serve everything as static pages, without automatic updating Some web-applications can't work like that. Mine has instant messaging, and I want the IM windows to be there when it loads. Besides, most users /like/ AJAX. They're not thinking "oh no, this application ruined the web", they're thinking "nice, the page updated itself". - The web application could use Flash or some other plugin, instead of the native HTML/Javascript Which of these are you suggesting developers do instead? Why is the HTML5 history/hashbang URL model not better than all of these?
- extension 16y agoThe back button is one of the greatest inventions in the history of usability. It's the centerpiece of the thick user agent, and the user agent is why the web took over the world. The web is a platform for modal applications with addressable state. To meet the expectations of users, any app on the web must somehow shape itself to that model. BTW have you ever used a navigation based app that didn't have a back button? Try the native YouTube app on iOS. It's infuriating.
- saurik 16y ago...but the native YouTube app on iOS does have a back button: obviously there's something important about navigation that "stack of pages with a back button" isn't sufficiently describing.
- lukeschlather 16y ago>it's just making the best user experience out of the functionality available That's a pretty broad generalization. On Twitter for example I'd say they're intentionally trying to make it harder for you to have a URL to reference an individual tweet.