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 -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -