javascript - Output decodeURIComponent string won't work -


in angularjs script, transform part of uri using vanillajs decodeuricomponent this:

var somevar = decodeuricomponent(uristring); //uristring = zao0%2b1 

but when outputting somevar using alert() or placing in inside of input field, keep getting zao0%2b1 instead of zao0+b1 output. going on?

looks input incorrect expected result.

if take expected result , encode different value returned using input

var str = "zao0+b1"// expected output // encode var encoded = encodeuricomponent(str);  console.log(encoded);// "zao0%2bb1" - differs input  // decode var result = decodeuricomponent(encoded);     console.log(result); // "zao0+b1" - same original , per expected result in question 

Comments

Popular posts from this blog

1111. appearing after print sequence - php -

node.js - Express and Redis - If session exists for this user, don't allow access -

excel - I can't get the attachement of the email PHP -