javascript 字符转换为ascii码,ascii码转换为字符

<script>
str="A";
code = str.charCodeAt();
str2 = String.fromCharCode(code);
str3 = String.fromCharCode(0x60+26);

document.write(code+'<br />');
document.write(str2+'<br />');
document.write(str3);
</script>

  

posted @ 2016-11-15 15:06  洋葱土豆随心匠  阅读(8477)  评论(0编辑  收藏  举报