javascript2014-07-28 08:35:45 3069
Unicode编码
function InUnicode(name) { var result = String(); if (name == '' || name == undefined) return name; for (var i = 0; i < name.length; i ) { result = name.charCodeAt(i) ","; } result = result.substring(0, result.length - 1); return result; }
Unicode解码
function OutUnicode(cod) { var result = String(), a = new Array(); a = cod.split(","); for (var i = 0; i < a.length; i ) result = String.fromCharCode(parseInt(a[i])); return result; }
彭亚欧个人博客原创文章,转载请注明出处
文章关键词:JavascriptUnicode编解码,Unicode编解码,htmlUnicode编码解码
文章固定链接:https://www.pengyaou.com/legendsz/front/codejs/MzA=.html
上一篇 Jq二级联动导航菜单
下一篇 HTML图片预览弹出层实现