Reputation: 347
Uri with +
symbol is not opening..
for example I have a file in folder !+123@1, want to show it in browser. window.open(url);
Upvotes: 1
Views: 259
Reputation: 2957
You can see how the text translates by using encodeURIComponent or online tool http://meyerweb.com/eric/tools/dencoder/
+
translates to %2B
Upvotes: 0
Reputation: 14869
The web browser interprets the plus +
symbol as space. Use encodeURIComponent to encode it instead.
Upvotes: 1
Reputation: 1194
Try to use encodeURIComponent
window.open("http://your-url.com/" + encodeURIComponent("foo+123.jpg"));
Upvotes: 3