Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js urlencode

/* There are 11 characters which are not encoded by encodeURI, 
but encoded by encodeURIComponent. */

encodeURI("test uri"); 
// "test%20uri"
encodeURI("test uri"); 
// "test%20uri"

encodeURI("test uri/with a slash"); 
// "test%20uri/with%20a%20slash"
encodeURIComponent("test uri/with a slash"); 
// "test%20uri%2Fwith%20a%20slash"
Source by thisthat.dev #
 
PREVIOUS NEXT
Tagged: #js #urlencode
ADD COMMENT
Topic
Name
7+7 =