setTimeout调用的函数不能传递参数~~~可行方法是var a="...";
var b="...";
var c="...";var the_timeout = setTimeout("alertAndRedirect();",3000);在函数alertAndRedirect直接使用全局变量~~~

解决方案 »

  1.   

    不能这样做呀,因为我的setTimeout()是要循环调用的,里面的参数也是动态传入的.
      

  2.   

    可以传的,但必须是全局的变量或对象
    <script language="javascript">
    var a="...";
    var the_timeout = setTimeout("show(a);",3000);
    function show(s){
    alert(s);
    }
    </script>
      

  3.   

    <script>
    var i = 1;
    window.resizeTo(50, 200);
    window.moveTo(screen.width-150,screen.height);
    function MSNPOP()
    {
        window.moveTo(screen.width-150,screen.height-70-i);
        i++;
        if(i<150)
        setTimeout("MSNPOP()", 1);
    }
    MSNPOP();
    </script>循环~~~~像这样就可以了~~~~
      

  4.   

    try:var the_timeout = settimeout("alertandredirect ("+a+","+b+","+c);",3000);
      

  5.   

    这样写
    var the_timeout = setTimeout(function()
    {
     alertAndRedirect (a,b,c);
    },3000);
      

  6.   

    <script>
    var total=1;
    var percent;
    function onload_start()
    {  
    if((total>0)&&(total<=10))
    total+=6;
    else if((total>10)&&(total<=35))
    total+=20;
    if(total<=50)
    {
    t=(total/50)*100;
    setTimeout("onload_start()",100) }
    else
    {
    //
    }
    }</script>
      

  7.   

    这样写:var the_timeout = setTimeout(function(){alertAndRedirect (a,b,c);},3000);