setTimeout("startTime(2011/3/6 16:05:48,7143)",1000);请问这样写哪里错了
错误提示:missing ) after argument list
输是缺少括号
请哪位高手指明一下
本人新手

解决方案 »

  1.   

    setTimeout("startTime(2011/3/6 16:05:48,7143)",1000);你引号里的startTime(2011/3/6 16:05:48,7143),这格式自己不觉得有问题吗?
      

  2.   

    setTimeout("startTime(2011/3/6 16:05:48,7143)",1000);setTimeout(
    function(){startTime('2011/3/6 16:05:48',7143);},1000
    );
      

  3.   

    setTimeout( "startTime('2011/3/6 16:05:48',7143);",1000);
    这样就可以。你这种格式的实参数据,应该加上引号。
      

  4.   


    当然有问题,你知道JS中弱类型语言,要是别的语言你这么传参编绎都过不了,字符串类型的你为什么不用引号,除非你是整型的,你要怕容易出错可以这样
    var date ="2011/3/6 16:05:48" 
    然后再  startTime(date,7143) 这样就结了.