js 字符ascii码转换函数
字符转ascii码:用charCodeAt();
ascii码砖字符:用fromCharCode();
看一个小例子
<script>
str="A";
code = str.charCodeAt();
str2 = String.fromCharCode(code);
str3 = String.fromCharCode(0x60+26); $("div").append(code+'<br />');
$("div").append(str2+'<br />');
$("div").append(str3);
</script>
输出:
65
A
z