Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

encodeuricomponent js

var set1 = ";,/?:@&=+$";  // Reserved Characters
var set2 = "-_.!~*'()";   // Unescaped Characters
var set3 = "#";           // Number Sign
var set4 = "ABC abc 123"; // Alphanumeric Characters + Space

console.log(encodeURI(set1)); // ;,/?:@&=+$
console.log(encodeURI(set2)); // -_.!~*'()
console.log(encodeURI(set3)); // #
console.log(encodeURI(set4)); // ABC%20abc%20123 (the space gets encoded as %20)

console.log(encodeURIComponent(set1)); // %3B%2C%2F%3F%3A%40%26%3D%2B%24
console.log(encodeURIComponent(set2)); // -_.!~*'()
console.log(encodeURIComponent(set3)); // %23
console.log(encodeURIComponent(set4)); // ABC%20abc%20123 (the space gets encoded as %20)

Comment

encodeuricomponent reverse

  var result = decodeURIComponent(input);
Comment

encodeuricomponent

The encodeURIComponent() function encodes a URI by replacing each instance of certain characters by one, two, three, or four escape sequences representing the UTF-8 encoding of the character.
console.log(encodeURIComponent('?x=test'));
// expected output: "%3Fx%3Dtest"
Comment

PREVIOUS NEXT
Code Example
Javascript :: install react native gifted charts 
Javascript :: jquery append element to body 
Javascript :: js writing to json file 
Javascript :: getting href value in jquery 
Javascript :: jquery value of input 
Javascript :: queryselector data attribute 
Javascript :: .textcontent 
Javascript :: reactnative get height screen 
Javascript :: get screen resolution jquery 
Javascript :: array remove index from array 
Javascript :: input onenter go to next input field javascript 
Javascript :: lodash remove undefined values from object 
Javascript :: javascript e.key 
Javascript :: jest match object properties 
Javascript :: binary to int javascript 
Javascript :: compare two arrays and make sure there are no duplicates js 
Javascript :: on scroll change navbar color 
Javascript :: javascript combine dictionaries 
Javascript :: vuejs react on route chagne 
Javascript :: Confirm the Ending 
Javascript :: how to stop react app in terminal 
Javascript :: how to compare strings in javascript ignoring case sensitive 
Javascript :: how to routing in react js 
Javascript :: jquery check if clicked outside div 
Javascript :: node js send fcm 
Javascript :: c# write json to file 
Javascript :: javascript remove last element from array 
Javascript :: radio button onclick jquery 
Javascript :: javascript assign 
Javascript :: print placeholder value javascript 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =