CanJS URL decoding issue

77 Views Asked by At

I have routing handling with:

'route': function(data) {
  if (data.widget) return;
  this.handle_route(data);
},
':widget route': function(data) {
  if (data.sub) return;
  this.handle_route(data);
},
':widget/:sub route': function( data ) {
  if (data.id) return;
  this.handle_route(data);
},
':widget/:sub/:id route': function(data) {
  this.handle_route(data);
}

but when I am on localhost/#!profile/log&flag=alpha, and refresh the page, the url of the page turns out to localhost/#!profile%2Flog=&flag=alpla

If I comment out:

// If no route was matched, it is parsed as a `&key=value` list.
if (url.charAt(0) !== can.route._querySeparator) {
  url = can.route._querySeparator + url;
}

It works fine. Is there any way not to touch this can.jquery-1.1.5.js file directly? Or is this issue of deparam method of canjs?

0

There are 0 best solutions below