在一个HTML页面弹出窗口

有时候需要在装载一个HTML页面的时候弹出一个简单的HTML页面窗口,但有不想去新建立一个HTML,可以使用JAVASCRIPT在现有的HTML页面中实现

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<script type="text/javascript">
function openwin() {
  OpenWindow=window.open("", "newwin", "height=250, width=250,toolbar=no,scrollbars="+scroll+",menubar=no");
  OpenWindow.document.write("<TITLE>维护公告</TITLE>")
  OpenWindow.document.write("<BODY style=\"background-image: url(/picsec/bj.gif)\">")
  OpenWindow.document.write("<h1>维护公告</h1>")
  OpenWindow.document.write("因博客数据升级,博客将于今日(07年03月24日)晚上22:00暂停服务30分钟,请各位网友注意调整时间。 ")
  OpenWindow.document.write("</BODY>")
  OpenWindow.document.write("</HTML>")
  OpenWindow.document.close()
}
</script>

</head>
<body onload="openwin()">

这样就实现了 ;)

Share

Related Posts

0 Responses to “在一个HTML页面弹出窗口”


  • No Comments

Leave a Reply