Solved

encodeURIComponent adds % characters

Posted on 2014-11-04
3
80 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

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

770 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