My app basically takes some form input and returns a set of results. I have two routes
routes: {
'': 'search',
'search': 'search',
'results/:query': 'results'
},
results: function(query) {
var search = new ResultsSearchView();
var grid = new GridView({ query: query });
}
If the query contains any characters / specifically (can totally happen in this case), they are added to the URL and my route breaks.
I have tried using encodeURI()
and encodeURIComponent()
bit I'm not having any luck. How are you folks handling such things?