日期:2014-05-16 浏览次数:20357 次
<SCRIPT LANGUAGE="javascript:> <!-- window.open ('page.html','newwindow','height=100,width=400,top=0,left=0,toolbar=no, menubar=no,scrollbars=no,resizable=no, location=no,status=no') //写成一行 --> </SCRIPT>
<SCRIPT LANGUAGE="javascript"> js脚本开始; window.open 弹出新窗口的命令; page.html 弹出新窗口的文件名; newwindow 弹出窗口的名字(不是文件名),可用空 ″代替; height=100 窗口高度; top=0 窗口距离屏幕上方的像素值; left=0 窗口距离屏幕左侧的像素值; toolbar=no 是否显示工具栏,yes为显示; menubar,scrollbars 表示菜单栏和滚动栏; resizable=no 是否允许改变窗口大小,yes为允许; location=no 是否显示地址栏,yes为允许; status=no 是否显示状态栏内的信息(通常是文件已经打开),yes为允许; </SCRIPT> js脚本结束。
<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>
<script language="javascript"> <!-- function openwin(){ window.open("page.html","","width=200,height=200" ;) } //--> </script>
<script language="javascript"> function closeit() { setTimeout("self.close()",10000) //毫秒 } </script>
<html> <head> <SCRIPT LANGUAGE="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 BGCOLOR=#FFFFFF>" ;) OpenWindow.document.write("<H1>Hello!</h1>" ;) OpenWindow.document.write("New window opened!" ;) OpenWindow.document.write("</BODY >" ;) OpenWindow.document.write("</HTML>" ;) OpenWindow.document.close() } </script> </head> <body> <a href="#" onclick="openwin()">打开一个窗口</a> <input type="bu