javascript十六进制数字和ASCII字符之间转换

var hex="0x29";//十六进制  
var charValue = String.fromCharCode(hex);//生成Unicode字符  
var charCode = charValue.charCodeAt(0);//获取指定字符的十进制表示.  
var hexOri="0x"+charCode.toString(16);;//将int值转换为十六进制  
alert("hex:"+hex+"
charValue:"+charValue+"
charCode:"+charCode+"
hexOri:"+hexOri);
原文地址:https://www.cnblogs.com/sprinng/p/5166058.html