框架中多个页面验证用户身份,弹出提示信息的一点技巧
2007-04-10 17:31
826 查看
作为单一页面,如果检测到用户没有登录或过期则用下面的代码就可以了。
<script language=javascript>
alert("No session!");
</script>
但是如果在框架中,那么一次就可能弹出多个提示框,这样情况很糟糕。可以使用单独一个Session来进行控制。比如弹出一次就不再弹出,但是必须定义好过期时间,否则过期时间之内就不再弹出了。另外就是使用一个页面来显示错误信息。下面的是页面的代码:
<html>
<head>
<title>Error message</title>
<META HTTP-EQUIV="Content-Type" content="text/html; charset=x-sjis">
<script language=javascript>...
function keyDown(e)
...{
var iekey=event.keyCode;
if(event.keyCode==13)...{window.close();}
}
document.onkeydown = keyDown;
</script>
</head>
<body topmargin=0 leftmargin=0 bottommargin=0 style="border:0" >
<form id="form1">
<table border=0 height="90" bgcolor="#DFDEE3" width="100%" style="height:105" >
<tr><td height="3"> </td></tr>
<tr>
<td valign=top rowspan=2 align=center>
<img src="images/AlterPic.GIF" />
</td>
<td >
<font size="2px"> Error Message</font>
</td>
</tr>
<tr>
<td align=left>
<input type=button tabindex="0" name="btn1" value="OK" style="width:90; height:22;" onclick="window.close();" />
</td>
</tr>
</table>
</form>
</body>
</html>
页面的弹出也需要进行控制,这样就更像alert出来的信息了。:)
<script language='Javascript'>
window.open('error.asp','error','top=350, left=350,width=250,height=50,Scrollbars=no,resizable=no,menubar=no,titlebar=no');parent.location='http://supportappwrk.japn.dell.com/pa/jp/index.asp';
</script>
Hope helpful.
<script language=javascript>
alert("No session!");
</script>
但是如果在框架中,那么一次就可能弹出多个提示框,这样情况很糟糕。可以使用单独一个Session来进行控制。比如弹出一次就不再弹出,但是必须定义好过期时间,否则过期时间之内就不再弹出了。另外就是使用一个页面来显示错误信息。下面的是页面的代码:
<html>
<head>
<title>Error message</title>
<META HTTP-EQUIV="Content-Type" content="text/html; charset=x-sjis">
<script language=javascript>...
function keyDown(e)
...{
var iekey=event.keyCode;
if(event.keyCode==13)...{window.close();}
}
document.onkeydown = keyDown;
</script>
</head>
<body topmargin=0 leftmargin=0 bottommargin=0 style="border:0" >
<form id="form1">
<table border=0 height="90" bgcolor="#DFDEE3" width="100%" style="height:105" >
<tr><td height="3"> </td></tr>
<tr>
<td valign=top rowspan=2 align=center>
<img src="images/AlterPic.GIF" />
</td>
<td >
<font size="2px"> Error Message</font>
</td>
</tr>
<tr>
<td align=left>
<input type=button tabindex="0" name="btn1" value="OK" style="width:90; height:22;" onclick="window.close();" />
</td>
</tr>
</table>
</form>
</body>
</html>
页面的弹出也需要进行控制,这样就更像alert出来的信息了。:)
<script language='Javascript'>
window.open('error.asp','error','top=350, left=350,width=250,height=50,Scrollbars=no,resizable=no,menubar=no,titlebar=no');parent.location='http://supportappwrk.japn.dell.com/pa/jp/index.asp';
</script>
Hope helpful.
相关文章推荐
- 框架中多个页面验证用户身份,弹出提示信息的一点技巧
- forms角色验证,以普通用户身份登陆管理页面先弹出警告信息窗口
- forms角色验证,以普通用户身份登陆管理页面先弹出警告信息窗口
- 页面弹出遮罩层,给用户提示信息,后台继续操作
- 实现功能:弹出一个DIV层提示等待信息,这个时候禁用用户操作页面中的其他内容
- 页面右下角弹出气泡提示框 提示用户 当前登录信息
- 让小区运营再智能一点,EasyRadius正式向WayOs用户提供到期弹出式提示充值页面
- 实现页面session验证,非法用户将弹出提示框并跳转页面
- JS在用户离开页面时提示信息&常用的弹出窗口用法
- bootstrap前端框架使用modal弹出框form表单submit操作后解决页面提示不显示
- JavaScript验证页面控件值时的提示信息的定位
- 用于离开页面时验证是否有资料修改,如有修改则弹出提示确认框
- GridView使用技巧之:新增记录、GridView内数据验证、删除信息提示
- MyEclipse .java .jsp .js页面 自动弹出信息提示框
- [转]页面外仿 MSN 弹出提示信息的脚本改进版(仅能在IE下运行!)
- 通过基类,轻松实现部分页面自动验证用户身份。
- 非常漂亮的让背景如此暗淡(一种弹出提示信息时页面背景色调改变的方法)
- 定时弹出提示信息 不刷新页面。
- js 弹出提示信息,并跳转指定页面代码分享
- 在用户离开页面(刷新、后退、关闭等)时提示信息