本文介绍了关于iframes的Window.top.reload = resettimer如何注销单页中的所有帧的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! onload = function () { var t; window.onload = resetTimer; document.onmousemove = resetTimer; document.onkeypress = resetTimer; document.onclick = resetTimer; function logout() { Ext.Msg.show({ title: 'Please sign in again', msg: 'Auto logout due to inactivity.', buttons: Ext.MessageBox.OK, width: 300, closable: false, fn: function (buttonId, text) { if (buttonId == 'ok') location.href = "<?php echo $this->createAbsoluteUrl('app/logout'); ?>"; } }); } function resetTimer() { clearTimeout(t); t = setTimeout(logout, 900000)//for 15 minutes // 1000 milisec = 1 sec } } if (typeof console == "undefined" || typeof console.log == "undefined") var console = {log: function () { }};</script> 我尝试过:What I have tried: onload = function () { var t; window.top.onload = resetTimer;window.top.onmousemove=resetTimerl window.top.onmousemove = resetTimer; window.top.onkeypress = resetTimer; window.top.onclick = resetTimer; function logout() { Ext.Msg.show({ title: 'Please sign in again', msg: 'Auto logout due to inactivity.', buttons: Ext.MessageBox.OK, width: 300, closable: false, fn: function (buttonId, text) { if (buttonId == 'ok') location.href = "<?php echo $this->createAbsoluteUrl('app/logout'); ?>"; } }); } function resetTimer() { clearTimeout(t); t = setTimeout(logout, 900000)//for 15 minutes // 1000 milisec = 1 sec } } if (typeof console == "undefined" || typeof console.log == "undefined") var console = {log: function () { }};</script>推荐答案 我尝试过:What I have tried: onload = function () { var t; window.top.onload = resetTimer;window.top.onmousemove=resetTimerl window.top.onmousemove = resetTimer; window.top.onkeypress = resetTimer; window.top.onclick = resetTimer; function logout() { Ext.Msg.show({ title: 'Please sign in again', msg: 'Auto logout due to inactivity.', buttons: Ext.MessageBox.OK, width: 300, closable: false, fn: function (buttonId, text) { if (buttonId == 'ok') location.href = "<?php echoonload = function () { var t; window.top.onload = resetTimer;window.top.onmousemove=resetTimer; window.top.onmousemove = resetTimer; window.top.onkeypress = resetTimer; window.top.onclick = resetTimer; function logout() { Ext.Msg.show({ title: 'Please sign in again', msg: 'Auto logout due to inactivity.', buttons: Ext.MessageBox.OK, width: 300, closable: false, fn: function (buttonId, text) { if (buttonId == 'ok') location.href = "<?php echo 这篇关于关于iframes的Window.top.reload = resettimer如何注销单页中的所有帧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 06-14 05:52