herf="http://xxx/a.jsp?docid=100&userid=xxx&pass=xxx"
这样的hyperlink当用户占击后docid,useri,passd三个参数都会显示在网址上,我现在想隐藏userid=xxx&pass=xxx这两个参数,请问能不能实现? 注意我的网页上有多个hyperlink, 每个hyperlink都有自己的用户及密码信息.

解决方案 »

  1.   

    哈哈~以前也遇到 这样的问题 哦 ~
    我的解决方法是设置一个隐藏的FORM
    <DIV style="display:none">
    <form action="a.jsp" method="post" name="myhiddenform">  //这里用POST方式
    <input type="hidden" name="docid"  id="docid"/>
    <input type="hidden" name="userid" id="userid"/>
    <input type="hidden" name="pass"   id="pass"/>
    </form>
    </DIV>//--------JS部分
    <script language="javascript">
    function OK(docid,userid,pass){
        document.getElementById("docid").value=docid;  
        document.getElementById("userid").value=userid;
        document.getElementById("pass").value=pass;
        document.myhiddenform.submit();    //提交隐藏的FORM
    }
    </script>
    <a onclick="OK(<%=docid%>,<%=userid%>,<%=pass%>)">Link</a>
    不知道你理解了没有?
      

  2.   

    明白,谢谢! 但能不能只显示docid但隐藏其它两个?
      

  3.   

    如果能够做到,用户查看页面源文件都不能发现这两个hidden的参数那就完美了.