AmpersandJS / ampersand-router

Clientside router with fallbacks for browsers that don't support pushState. Mostly lifted from Backbone.js.
MIT License
70 stars 16 forks source link

pushState should be true by default when starting history #12

Closed HenrikJoreteg closed 9 years ago

latentflip commented 10 years ago

My only concern here is what happens on IE9 out of the box with pushState. Though, I must admit I don't know exactly how backbone.router + pushState: true actually works in IE9. I bet @lukekarrys does though.

lukekarrys commented 10 years ago

In IE9, Backbone just makes all urls hostname.com/#path/to/page, but it still works when you do history.navigate('/path/to/page').

I've run into an issue in the past where I was using urls like /path/to/page?param=1&other=2 and trying to get the params through location.search which doesnt work because it gets translated to /#path/to/page?param=1&other=2 where there is no location.search. This was generally just a Bad Idea since Backbone doesnt even support query params.

So the only cases where I see this breaking is where devs are manually using location.search or location.hash. For my previous use case, I ended up using a query params plugin for Backbone. Maybe that's something we look in to making easier to do with the router?