本帖最后由 u013611023 于 2014-05-24 14:32:19 编辑

解决方案 »

  1.   

    setTimeout(function(){openwindow(m)},10)
      

  2.   

    n是全局的
    var n=0;
    function openwindow(m){ 
         window.open("images/pic.jpg")
          n++;
        if(n<m)
    {
         setTimeout(function(){
     openwindow(m);
     },40)
    }
    }
      

  3.   

    setTimeout(openwindow(),10); 这里的openwindow()没有传m参数,已经出错了。
    其实用一个变量m就可以,n可以不需要。
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title></title>
    <script type="text/javascript">
    function openwindow(m){ 
         window.open("images/pic.jpg")
         if(m>1){
    setTimeout(function(){
    openwindow(m-1)
    },10);
         }
    }</script>
    </head><body>
    <input name="button" type="button" value="图片" onClick="openwindow(3)">
    </body>
    </html>