for(int i=1;i<=n;i++)
{
Response.Write("<script language=javascript>window.open('"+str5+"');</script>");
}
请问如何能不让n个页面同时打开?而是关闭了一个再打开另一个呢?

解决方案 »

  1.   

    Response.Write("<script language=javascript>setInterval(openWin(),2000)</script>");
    openWin()是事先定义好的打开窗口的函数
      

  2.   

    openWin()里面怎么写?
    public void openWin()
    {
    Response.Write("<script language=javascript>window.open('"+str5+"');</script>");
    }
    是这样吗?
      

  3.   

     <a href="#" onclick="window.open('http://www.baidu.com/','a');">dd</a>
      <a href="#" onclick="window.open('http://www.google.com/','a');">dd</a>
      

  4.   

    说实话没看懂 但想个很笨的办法
     不是有个<n么
     i+1的时候你吧i-1关闭不就成了么window.close();
      

  5.   

        public void OpenWebForm(string url, string formName, )
        {
            string js = @"<Script language='JavaScript'>";            js += "var iWidth = 0;";
                js += "var iHeight = 0;";
                js += "iWidth=window.screen.availWidth-10;";
                js += "iHeight=window.screen.availHeight-24;";
                //js += "iWidth=window.screen.availWidth;";
                //js += "iHeight=window.screen.availHeight;";
                js += "var szFeatures ='width=' + iWidth + ',height=' + iHeight + ',top=0,left=0,location=no,menubar=no,resizable=yes,scrollbars=no,status=no,titlebar=no,toolbar=no,directories=no';";
                js += "window.open('" + url + @"','" + formName + "',szFeatures);";
            
            js += "</Script>";
            HttpContext.Current.Response.Write(js);
        }    protected void btnlogin_Click(object sender, ImageClickEventArgs e)
        {
          JScript.OpenWebForm("Base/SysFrame/MainFrame.aspx", "");
    }
      

  6.   

    楼主在搞什么东东?广告?只能在页面的onunload中定义吧,如果你搞几万个窗口,不是要把用户点死?
      

  7.   

    用一个TextBox记录执行第几次了 没次想打开一个页面都要点击按钮触发事件
    if( TextBox1.Text=="") count=n;
    else count=n-Convert.ToInt32(TextBox1.Text);
    if(count>=1) 
    {
    Response.Write("<script language=javascript>window.open('"+str5+"')</script>"); 
    count--;
    TextBox1.Text=(n-count).ToString();
    }