简体   繁体   English

停止或禁用JavaScript中的浏览器刷新按钮

[英]Stop or Disable browser Refresh button in javascript

I work in Ext JS. 我在Ext JS中工作。 in Ext JS webdesktop application , when i click browser refresh button it reload and goes to login window. 在Ext JS webdesktop应用程序中,当我单击浏览器刷新按钮时,它将重新加载并进入登录窗口。 Because my first page is login. 因为我的第一页是登录。 For this reason i need to stop this event or disable browser refresh button when this application launch. 因此,启动此应用程序时,我需要停止此事件或禁用浏览器刷新按钮。 i can stop F5 but can't browser refresh button. 我可以停止F5,但无法浏览器刷新按钮。 So please some one help me for this issue. 所以请有人帮我解决这个问题。 Thanks... 谢谢...

No, wrong issue 不,错误的问题

You have to memorize the current View he is in. As far as i remember, Ext has mechanisms for that, otherwise you can still use a (session-)cooke. 您必须记住他所处的当前View。据我所知,Ext具有实现该功能的机制,否则您仍然可以使用(session-)cooke。

and you don't have to start you application with the login-screen. 而且您不必从登录屏幕启动应用程序。 It is just one view, and imo. 这只是一个视图,而且是imo。 the one you would want to use as few as possible. 您想要使用的越少越好。

So. 所以。 on page load, check wether he is logged in, if no, show him the login-view, if yes check which view he was in and render it, otherwise send him to the start point. 在页面加载时,检查是否已登录(如果否),请向他显示登录视图,如果是,则检查他所处的视图并进行渲染,否则将其发送到起点。

this is basically the loop you have to send him through, on pageload, on refresh, onlogin, ... 基本上,这是您必须在页面加载,刷新,登录时向他发送的循环...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM