网页制作中常用的一些代码小结

[来源:来自网络] [作者:不详] [日期:2007-12-12] [热度:]

点击返回上页代码:

<form>
<p><input TYPE="button" VALUE="返回上一步" ONCLICK="history.back(-1)"></p>
</form>

弹出警告框代码:

<form>
<p><input TYPE="button" VALUE="弹出警告框" ONCLICK="AlertButton()"></p>
</form>
<script language="JavaScript"><!--
function AlertButton(){window.alert("要多多光临呀!");}
// --></script>

点击打开新窗口

<form>
<p><input TYPE="button" VALUE="打开新窗口" ONCLICK="NewWindow()"></p>
</form>
<script language="JavaScript"><!--
function NewWindow(){window.open("http://www.webjx.com","","height=240,width=340,status=no,location=no,
toolbar=no,directories=no,menubar=no");}
// --></script></body>

删除记录时弹出确认框:

<script LANGUAGE="VBSCRIPT">
a=msgbox("真的要删除该记录吗?",1,"注意")
if a=1 then
location="Dodelete.asp?id=" //指向执行删除的页面Dodelete.asp
else
history.go(-1)
end if
</script>

关闭打开的窗口

< a href="/" onclick="javascript:window.close(); return false;">关闭窗口</a>

一网情深,为您提供免费的网络学习资源