合作联系微信: w6668263      合作联系电话:156-6708-8263     

2012年12月7日

分享javascript来对html编码和解码

摘要: /** *htmlEncode编码 */ function htmlEncode(str) { var s = ""; if (str.length == 0) return ""; s = str.replace(/&/g, "&amp;"); s = s.replace(/</g, "&lt;"); s = s.replace(/>/g, "&gt;"); s = s.replace(/\'/g, "&#39;" 阅读全文

posted @ 2012-12-07 15:56 爱记录的龙果果 阅读(385) 评论(0) 推荐(0)

导航