Call the method, write the following function in a JS file that supports calling
The website to be encode will be changed
<textarea id="runcode2093"><script> function UrlEncode (str) {return transform (str); Function transform (s) {var hex= ' var i,j,t j=0 for (i=0; i<s.length; i++) {t = Hexfromdec (s). charCodeAt (i)); if (t== ') {t= '; } hex + = '% ' + t; return hex; } function Hexfromdec (num) {if (num > 65535) {return ("err!")} A-Math.Round (num/4096-. 5); Temp1 = Num-first * 4096; Second = Math.Round (temp1/256-.5); TEMP2 = Temp1-second * 256; Third = Math.Round (TEMP2/16-. 5); Fourth = Temp2-third * 16; Return ("" +getletter (third) +getletter (fourth)); } function Getletter (num) {if (num <) {return num; else {if (num = =] {return "A"} if (num = =) {return "B"} if (num =) {return "C"} if (num =) {R Eturn "D"} if (num = = return "E"} if (num =) {return ' F '}}} alert (UrlEncode ("Programming")); </script></textarea>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]