注册 登录
编程论坛 ASP.NET技术论坛

c# 谈框问题

Love_2009 发布于 2010-11-08 21:38, 422 次点击

 Response.Write("<script>window.open('playListMusic.aspx?id=" + musicList + " ','','width=380,height=260')</script>");




怎么这句话不能弹出playListMusic.aspx框出来
1 回复
#2
jalonlovesja2010-11-09 08:58
<html>
  <head>
  <script LANGUAGE="JavaScript">
  <!--
  function openwin() {
  window.open ("page.html", "newwindow", "height=100, width=400, toolbar =no, menubar=no, scrollbars=no, resizable=no, location=no, status=no") //写成一行
  }
  //-->
  </script>
  </head>
  <body onload="openwin()">
  任意的页面内容...
  </body>
  </html>

  这里定义了一个函数openwin(),函数内容就是打开一个窗口。在调用它之前没有任何用途。怎么调用呢?
  方法一:<body onload="openwin()"> 浏览器读页面时弹出窗口;
  方法二:<body onunload="openwin()"> 浏览器离开页面时弹出窗口;  
  方法四:用一个按钮调用:
  <input type="button" onclick="openwin()" value="打开窗口">
1