现在cookies里   userid   username   userpwd   三个cookies值 我要在html页面中用javascript读出这三个值发送到指定邮箱中, 怎么现实?

解决方案 »

  1.   

    //存cookie:
    function setCookie(key,value){
       document.cookie = document.cookie +";" + key + "=" + value;
    }
    //从cookie中取值:
    function getCookie(c_name)
    {
    if (document.cookie.length>0)
      {
      c_start=document.cookie.indexOf(c_name + "=")
      if (c_start!=-1)[code=JScript]
        { 
        c_start=c_start + c_name.length+1 
        c_end=document.cookie.indexOf(";",c_start)
        if (c_end==-1) c_end=document.cookie.length
        return unescape(document.cookie.substring(c_start,c_end))
        } 
      }
    return ""
    }[/code]
      

  2.   

    js不能发邮件的!
    你只能用js  ajax访问动态页面才可以的