参数解释:
〈SCRIPT LANGUAGE="javascript"〉 js脚本开始; window.open 弹出新窗口的命令; 'page.html' 弹出窗口的文件名; 'newwindow' 弹出窗口的名字(不是文件名),非必须,可用空''代替; height=100 窗口高度; width=400 窗口宽度; top=0 窗口距离屏幕上方的象素值; left=0 窗口距离屏幕左侧的象素值; toolbar=no 是否显示工具栏,yes为显示; menubar,scrollbars 表示菜单栏和滚动栏。 resizable=no 是否允许改变窗口大小,yes为允许; location=no 是否显示地址栏,yes为允许; status=no 是否显示状态栏内的信息(通常是文件已经打开),yes为允许; 〈/SCRIPT〉
例子: <a href="javascript:;" onClick="expandingWindow('http://www.sina.com.cn')">打开新浪网站</a>
<SCRIPT LANGUAGE="JavaScript"> function expandingWindow(website) { var heightspeed = 5; var widthspeed = 10; var leftdist = 0; var topdist = 0; var winwidth = 400 - leftdist; var winheight = 500 - topdist; var sizer = window.open("","","left=" + leftdist + ",top=" + topdist + ",width=1,height=1,scrollbars=no,toolbar=no,location=no,menubar=no,resizable=no,status=no"); for (sizeheight = 1; sizeheight < 500; sizeheight += heightspeed) { sizer.resizeTo("1", sizeheight); } for (sizewidth = 1; sizewidth < 400; sizewidth += widthspeed) { sizer.resizeTo(sizewidth, sizeheight); } sizer.location = website; } </script>
-----------------------------------------------
<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 οnlοad="openwin()">
...任意的页面内容...
</body>
</html>
-----------------------------------------------