设为首页  
联系我们  
加入收藏  
网页制作 冲浪宝典 图形图像 操作系统 软件教学 编程开发 认证考试 安全技术 站长专区 文学驿站 娱乐天地 游戏天地 办公软件
文章搜索
您的位置: 首页 >> 文章首页 >> 网页制作 >> 心得技巧 >> javascript控制cookies及在跳出本页给出提示,是否放弃操作!
精品推荐
心得技巧点击TOP10
·初学者入门:如何学习网页制作?
·网页自动转向代码
·Google Maps API 简易使用文件
·关于网页代码加密解密保护
·实现浏览器全屏窗口的几种方法
·javascript控制cookies及在跳出本页给出提示,是否放弃操作!
·用XML+JSP实现网页内容动态显示的方案
·网页屏蔽(左右键,代码等)的非JS方法
·网页设计之css+div PK table+css
·如何做才能成为一名优秀的网页设计师
网页制作点击TOP10
·菜鸟架设动网论坛全教程
·网页模板的使用方法 (教程)
·网页对联广告代码效果大全
·初学者入门:如何学习网页制作?
·用JavaScript实现文件图片滚动效果
·常用CSS大全
·网页自动转向代码
·图片循环滚动完美解决
·DIV CSS网页布局实例解析:实现表格形式
·JS表格排序新法
精选专题

javascript控制cookies及在跳出本页给出提示,是否放弃操作!

作者: 来源: 时间:2007-4-2 11:17:00

javascript控制cookies及在跳出本页给出提示,是否放弃操作!(3)     } else {
        /**//* this sets the value to true and nothing else will happen,
        the user will be able to log on*/
        document.Form1.cookieexists.value ="true"
    }
}
/**//* Set a cookie to be sure that one exists.
Note that this is outside the function*/
document.cookie = 'killme' + escape('nothing')

</script>
<BODY onbeforeunload="RunOnBeforeUnload()" id="Posts">
<FORM Name="Form1" id="Form1">
  <input type="text" name="cookieexists" value="false">
</FORM>
<a href="test.html">中微家校通</a>

</BODY>
</HTML>
<SCRIPT LANGUAGE="JavaScript">
<!--
g_blnCheckUnload = true;
function RunOnBeforeUnload()
{
    if (g_blnCheckUnload)
    {
        window.event.returnValue = 你确是要放弃操作吗?';
    }
}
//-->
</SCRIPT>

2.html(简单的操作cookies)

<html>
<head>
<title> 新文档 </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="FLASHSoft">
<meta name="Keywords" content="">
<meta name="Description" content="FlashSoft">
<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
</head>
<body>
<script language="JavaScript" type="Text/JavaScript">
<!--
// 实在懒得写了,为了减少字节量
//添加和获得都已经写好了,删除,你只要把时间改为-1就可以了,懒得封装了,实在无意义[代码moz兼容,值得一提,moz跟ie不是一个地方存cookie的]
function Cookie(){
  this.SetValue=function(name,value,hours,path,domain,secure){
    var str=new String();
    var nextTime=new Date();
    nextTime.setHours(nextTime.getHours()+hours);

共4页 9 7 [1] [2] [3] [48 :>

javascript控制cookies及在跳出本页给出提示,是否放弃操作! 相关文章:
javascript控制cookies及在跳出本页给出提示,是否放弃操作! 相关软件:
特别声明:本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系编辑人员,我们尽快予以更正。
转载请注明来源:http://www.xgdown.com