代码如下 | 复制代码 |
<script type="text/javascript"> //js获取cookie var acookie=document.cookie.split("; "); function getck(sname) {//获取单个cookies for(var i=0;i<acookie.length;i++){ var arr=acookie[i].split("="); if(sname==arr[0]){ if(arr.length>1) return unescape(arr[1]); else return ""; }} return ""; } //给相应的form里的input赋值 document.form_name.input_name.value=getck("username"); </script> |
时间: 2024-11-08 23:51:25