Javascript定时自动跳转
主代码:
<script language="JavaScript" type="text/JavaScript">
<!--
function gotoPage(){
window.location="member/index.htm";
}
function jump() {
setTimeout("gotoPage()",2000);
}
//-->
</script>
调用代码:
<script language="javascript">
jump();
</script>
Javascript退出并跳出框架
<SCRIPT language=JavaScript>
<!--
function logout(){
if (window.confirm("您确实要退出登录吗?")){
document.write("<link rel='stylesheet' href='member_logout.asp'/>");
parent.parent.navigate("../member_login.asp");
}
}
//-->
</SCRIPT>
Javascript删除确认按钮
<A href='#' onClick="javascript:if(confirm('确定要删除')){location.href='job_del.asp?id=<%=rs("id")%>'}else{return false;}">删除</A>
删除成功后刷新父窗口
if err.number=0 then
Response.Write("<script>alert('职位删除成功');window.opener.location='job_apply_list.asp';window.close();</script>")
Response.End()
else
Response.Write("<script>alert('职位删除失败');window.close();</script>")
Response.End()
end if
在网页中用代码调用打印机打印当前页面
代码加入 HTML 的〈BODY〉区的任意位置:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
if (window.print)
{document.write('<form>'+ '<input type=button name=print value="打印页面" '+'onClick="javascript:window.print()"></form>');}
//-->
</script>
(说明:document.write 一句请写在一行,不要回车断行。)