Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why is %20 turned into a space when using Router.navigate? #4059

Closed
davis opened this issue Jul 14, 2016 · 5 comments
Closed

why is %20 turned into a space when using Router.navigate? #4059

davis opened this issue Jul 14, 2016 · 5 comments
Labels

Comments

@davis
Copy link

davis commented Jul 14, 2016

This issue has been here for a while, I couldn't find anything issues, so I went ahead and made a test repo. Was hoping you could provide some insight as to why %20s are being turned into spaces.

https://github.com/davis/backbone-router-test

Thanks!

@davis
Copy link
Author

davis commented Jul 14, 2016

Test case

var Backbone = require('backbone');

var router = new Backbone.Router();
Backbone.history.start();

router.navigate('space%20space');

Expected result

Url looks something like http://localhost:3000/space%20space

Actual result

Url looks like http://localhost:3000/space space

Why this is a problem

This breaks URLs when copy pasting them, etc, and in general is inconsistent behavior, because none of the other URLencoded chars get decoded.

How to see it for yourself

git clone [email protected]:davis/backbone-router-test.git
cd backbone-router-test
open index.html

@lfilho
Copy link

lfilho commented Jul 25, 2016

Not sure but are you using jQuery 3 under the hood? It might be it: https://jquery.com/upgrade-guide/3.0/#breaking-change-jquery-param-no-longer-converts-20-to-a-plus-sign

@Flamefork
Copy link
Contributor

Looks like #4025

@francescq
Copy link

francescq commented Mar 28, 2017

Any plan on releasing a version containing #4025 fix?

1.3.4 maybe?

Thanks!

@jgonggrijp
Copy link
Collaborator

Seems to have been fixed in #4026.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants