我记得random()在使用前要初始化。虽然是用的jsp,不过还是可以通过MSDN找到答案.

解决方案 »

  1.   

    <script language=javascript>
    <!--
    HTMLSTR = '<a href="bbss.jsp?tempisd='+Math.random()+'">传随机值</a>';
    document.write (HTMLSTR)
    //-->
    </script>
      

  2.   

    多谢!!
    但是我需要这么用啊:
    <a href="bbss.jsp?tempisd="+Math.random().toString()>传随机值</a>
    <a href="bbss2.jsp?tempisd="+Math.random().toString()>传随机值2</a>
    <a href="bbss3.jsp?tempisd="+Math.random().toString()>传随机值3</a>
    那该怎么办啊??有很多的超链!!!
    用上面的方法不方便
      

  3.   

    我用onclick也不行<a href="" onClick="bbss.jsp?tempisd="+Math.random().toString()>传随机值2</a>
      

  4.   

    <script language=javascript>
    <!--
    function t(param)
    {
       window.location=="bbss.jsp?tempisd="+param;
    }
    //-->
    </script><a href="t(Math.random().toString())">传随机值</a>
      

  5.   

    那bbss.jsp和tempisd可以作为参数传吗?多谢!!
      

  6.   

    to: shixueli(渴望成功)你的不对啊!!!
      

  7.   

    <script language=javascript>
    <!--
    function t(param)
    {
       window.location=="bbss.jsp?tempisd="+param;
    }
    //-->
    </script><a href='' onclick="t(Math.random().toString())">传随机值</a>
      

  8.   

    Math.random()必须要在客户端脚本中执行吧,但现在你的语法好象是在HTML中执行应该是不行的,试试将Math.random()放在<script language=javascript></script>标记对中
      

  9.   

    to:saintKnight(saintKnight)怎么放啊?