Home  >  Article  >  Web Front-end  >  Script code to implement UrlEncode and UrlDecode with JavaScript_javascript skills

Script code to implement UrlEncode and UrlDecode with JavaScript_javascript skills

WBOY
WBOYOriginal
2016-05-16 19:02:331165browse

Copy code The code is as follows:


Convert vbscript function into javascript for easy use in non-IE browsers

Copy code The code is as follows:

function str2asc(strstr){
return (" 0" strstr.charCodeAt(0).toString(16)).slice(-2);
}
function asc2str(ascasc){
return String.fromCharCode(ascasc);
}

Copy code The code is as follows:




Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn