javascript小技巧【待续】

(1)点击按钮,让窗口刷新

<SCRIPT LANGUAGE="JavaScript">

function displayAlert() {

this.location.reload();//refresh

window.close();//close

}

</SCRIPT>

<BODY>

<FORM>

Click the button on the left for a reminder in 5 seconds;

click the button on the right to cancel the reminder before

it is displayed.

<P>

<INPUT TYPE="button" VALUE="5-second reminder"

NAME="remind_button"

onClick="timerdisplayAlert()',3000)">

<INPUT TYPE="button" VALUE="Clear the 5-second reminder"

NAME="remind_disable_button"

onClick="clearTimeout(timerID)">

</FORM>

</BODY>

(2)让窗体的大小受到控制,并且没有工具栏

<script language="javascript">

<!--

focus();

resizeTo(510, 358);

/-->

</script>

window.open("tg.htm","_blank","toolbar=no, status=no,menubar=no, scrollbars=no,resizable=no,width=360,height=360,left=20,top=50");

tg.htm-----要找开的网页地址

_blank----打开的新窗口名称

toolbar----工具栏

status-----状态栏

menubar--菜单栏

scrollbars-滚动条

resizable--是否可以改变窗口大小

width-------窗口宽

height-----窗口高

left---------窗口位置(距左边屏幕距离)

top---------窗口位置(距上边屏幕距离)