JS cookie中文乱码解决方法
2014-01-28 09:51
549 查看
function SetCookie(name, value) { var exp = new Date(); exp.setTime(exp.getTime() + 3 * 24 * 60 * 60 * 1000); //3天过期 document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString(); return true; };
function getCookie(name) { var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)")); if (arr != null) return arr[2]; return null; };
相关文章推荐
- JS cookie中文乱码解决方法
- JS读取PHP中设置的中文cookie时出现乱码的解决方法
- C# .net中cookie值为中文时的乱码解决方法
- 传输中文乱码js解决方法
- js后台post传值出现中文乱码解决方法
- 从js向Action传中文参数出现乱码问题的解决方法
- 取出Cookie中的中文显示乱码解决方法
- cookie中文乱码解决(php/js)
- js escape,unescape解决中文乱码问题的方法
- js中,怎么解决cookie里面中文乱码问题
- JS文件中的中文在网页上显示为乱码解决方法
- MyEclipse中JS中文注释乱码解决方法
- C# .net中cookie值为中文时的乱码解决方法
- 从js向Action传中文参数出现乱码问题的解决方法
- Node.js抓取中文网页乱码问题和解决方法
- Node.js抓取中文网页乱码问题和解决方法
- JSP、AJax中文乱码问题解决,escape(), encodeURI(), encodeURIComponent(),js对参数连续两次调用 encodeURI(String) 方法
- jsp获取JavaScript生成的中文cookie出现乱码问题解决方法
- js escape,unescape解决中文乱码问题的方法
- C# JS URL 中文传参出现乱码的解决方法