惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
罗磊的独立博客
T
The Blog of Author Tim Ferriss
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
Last Week in AI
Last Week in AI
美团技术团队
Google Online Security Blog
Google Online Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
D
Docker
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件
月光博客
月光博客
L
LINUX DO - 最新话题
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
W
WeLiveSecurity
H
Heimdal Security Blog
Vercel News
Vercel News
SecWiki News
SecWiki News
Forbes - Security
Forbes - Security
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
TaoSecurity Blog
TaoSecurity Blog
T
Troy Hunt's Blog
A
About on SuperTechFans
C
Check Point Blog
S
Security Affairs
Hacker News - Newest:
Hacker News - Newest: "LLM"
AI
AI
WordPress大学
WordPress大学
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Help Net Security
Help Net Security
博客园_首页
The Last Watchdog
The Last Watchdog
S
SegmentFault 最新的问题
Hugging Face - Blog
Hugging Face - Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Engineering at Meta
Engineering at Meta
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
I
Intezer
K
Kaspersky official blog
M
MIT News - Artificial intelligence
J
Java Code Geeks
G
GRAHAM CLULEY
P
Palo Alto Networks Blog

博客园 - Elliott.Dong

数据库命名与注释规范 关于js中window.location.href,location.href,parent.location.href,top.location.href的用法 - Elliott.Dong - 博客园 虚拟目录继承根Web.Config的问题解决(转) - Elliott.Dong - 博客园 【转】Windows7下IIS7.5的伪静态URL Rewrite安装配置和案例综合 win7下添加microsoft loopback adapter实现xp mode网络共享 sql server 2000日志文件收缩 jquery-autocomplete 参数说明 【转】启用Visual Studio 对jQuery的智能感知 - Elliott.Dong .net Remoting与Web Service的比较 VmWare虚拟机增加硬盘容量 转:sql server 2008收缩数据库日志 格式字符替换 - Elliott.Dong - 博客园 DataView 的 Distinct 功能 Windows 7中使用USB KEY 解决XP下不能识别USB鼠标问题 Silverlight 2 开发环境【转】 oracle trunc()函数的用法 [备忘]Visual Studio常用小技巧 VS.Net中的快捷键技巧
处理Flex 页面的后退/前进/刷新/关闭事件
Elliott.Dong · 2009-04-08 · via 博客园 - Elliott.Dong

 Flex 做的 web 页面在整个程序中只有一个 url, 当我们按了 IE 上的后退/前进/刷新/关闭时就会退出到第一次 load 时的页面,重新加载过。浏览器刷新后,所有东西都要重新加载,为避免用户出现误操作,我们可以做些相应的处理,当你登录后就会监听IE 的后退/前进/刷新/关闭各功能,提示是否要执行。

通过javascript 的 onbeforeunload 和 onunload 事件与 ActionScript 的addCallback方法 (如下边的“getUnsavedDataWarning();”方法)来实现监听:

1. 在 index.template.html 中增加javascript

Code

2.在 Flex 的 application 页面里加增一个addCallback, 在页面加载完后就addCallback:

Code