我写入cookie使用的vbscript
<%
response.cookies("test")="你好abc"
%>

解决方案 »

  1.   

    读取代码
    <script language="JavaScript">
    function  readCookie(name)  
    {  
       var  cookieValue  =  "";  
       var  search  =  name  +  "=";  
       if(document.cookie.length  >  0)  
       {    
           offset  =  document.cookie.indexOf(search);  
           if  (offset  !=  -1)  
           {    
               offset  +=  search.length;  
               end  =  document.cookie.indexOf(";",  offset);  
               if  (end  ==  -1)  end  =  document.cookie.length;  
               cookieValue  =  unescape(document.cookie.substring(offset,  end))  
           }  
       }  
       return  cookieValue;  
    }  
    document.write(readCookie("test")); 
    </script>
      

  2.   

    你为什么还要加一个unescape()呢?
    unescape 方法返回一个包含 charstring 内容的字符串值。所有以 %xx 十六进制形式编码的字符都用 ASCII 字符集中等价的字符代替。以 %uxxxx 格式(Unicode 字符)编码的字符用十六进制编码 xxxx 的 Unicode 字符代替. 注意   unescape 方法不能用于解码统一资源标识码 (URI)。解该码可使用 decodeURI 和 decodeURIComponent 方法。