.replace(namedParam, function(match, optional){
return optional ? match : '([^\/]+)';
})
- .replace(splatParam, '(.*?)') + '(?:$|[?#])');
+ .replace(splatParam, '(.*?)') + '(?:\\?.*)?$');
var route = {};
}
};
- var currentPath = window.location.pathname,
+ var currentPath = window.location.pathname + window.location.search,
currentRoute = routes.recognize(currentPath);
currentRoute.run('load', currentPath);
if (window.history && window.history.pushState) {
$(window).on('popstate', function() {
- var path = window.location.pathname;
+ var path = window.location.pathname + window.location.search;
if (path === currentPath) return;
currentRoute.run('unload');
currentPath = path;