Thursday, May 23, 2024
 Popular · Latest · Hot · Upcoming
113
rated 0 times [  117] [ 4]  / answers: 1 / hits: 37672  / 10 Years ago, fri, september 12, 2014, 12:00:00

I need to pass some parameters in the url and they can have special characters like , spanish Ñ or ñ, : spaces and accents.



What is the propper way to encode them before adding to the url or in case I got in the html like that, read them?



I tried this:



arrayData[i] = pair[1].replace('+',  ).replace('%22', );


But just get working with + or spaces, not both at the same time or in 2 lines:



    arrayData[i] = pair[1].replace('+',  );
arrayData[i] = pair[i].replace('%22', );

More From » html

 Answers
11

You can try encodeUri Built-in function, for example



encodeURI('coño funcionó!')

[#69477] Wednesday, September 10, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
sylviakaitlinj

Total Points: 564
Total Questions: 114
Total Answers: 105

Location: Jordan
Member since Thu, Aug 11, 2022
2 Years ago
sylviakaitlinj questions
;