How to encode javascript function -


how can encode parameters in javascript?

this function , parameter called newvalue

<script> function selectchanged(newvalue)  { location.href="tester?restid=" + newvalue; } </script> 

this how tried adeneos suggestion

   window.location.href = "tester?restid=" + encodeuricomponent(newvalue); 

but not work.

this getting:

tester?restid=38619 

this want want

 tester%3frestid%3d38619%21  

function selectchanged(newvalue)  {     window.location.href = encodeuricomponent("tester?restid=" + newvalue); } 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -