function 解码(string){ var new_code = newArray(); var s = string.split("\\"); for (i = 1; i < s.length; i++){ s[i] = s[i].replace('x', ''); new_code += String.fromCharCode(parseInt(s[i], 16)) } return new_code; } function 编码(string){ var new_code = newArray();var i,s; for(i=0;i<string.value.length;i++){ s=string.value.charCodeAt(i).toString(16); new_code+="\\x"+s;