探寻者飞

我正像学走路的娃娃,期盼有一天会跑、会飞翔......

博客园 首页 新随笔 联系 订阅 管理
 在html里调用如下

函数打开窗口  
  function   openaddcalendar()  
  {  
  var   width=210;  
  var   height=180;  
  var   surl='../openwindow.aspx?url=calendar.aspx';  
  var   returnVal;  
  returnVal=window.showModalDialog   (surl   +   '&width='   +   width   +'&height='+   height   ,'','dialogWidth='   +   width   +   'px;dialogHeight='   +   height   +   'px;resizable=no;help=no;center=yes;status=no;scroll=no;edge=sunken');  
  if   (returnVal=="True")  
  {  
  window.location.href=window.location.href;  
  window.location.reload;  
  }  
  }  
  如果需要判断是否刷新父窗口,就判断这个返回值,  
  这个返回值returnVal需要从模态窗口中返回  
    也就是用户点击模态窗口中的“关闭按钮”(一个button而不是右上角的"X")时  
                          Response.Write("<script   language=javascript>")  
                          Response.Write("window.returnValue='True';window.close()")  
                          Response.Write("</script>")  
  当然,如果用户直接点“X”来关闭窗口,就没法刷新了  
   
  如果不需要判断,就直接  
  window.location.href=window.location.href;  
  window.location.reload;  
  好了

posted on 2007-09-18 14:53  探寻者飞  阅读(5719)  评论(0)    收藏  举报