Solved

encodeURIComponent adds % characters

Posted on 2014-11-04
3
84 Views
Last Modified: 2014-11-05
Hi;

I have a code in which i use encodeURIComponent and it adds % characters to the file i generated. E.g. for space %20 is added. How can I avoid this?

Regards.
0
Comment
Question by:jazzIIIlove
  • 2
3 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 40422193
How can I avoid this?

Don't use encodeURIComponent, maybe you don't need it... or the process saving your data should decode first
0
 
LVL 12

Author Comment

by:jazzIIIlove
ID: 40422452
Hi,

I haveto use it against xss.
0
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 40422459
decodeURIComponent
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question