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

推荐订阅源

L
LINUX DO - 热门话题
Stack Overflow Blog
Stack Overflow Blog
B
Blog
WordPress大学
WordPress大学
Project Zero
Project Zero
P
Palo Alto Networks Blog
阮一峰的网络日志
阮一峰的网络日志
博客园 - 司徒正美
有赞技术团队
有赞技术团队
S
SegmentFault 最新的问题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
小众软件
小众软件
T
Tailwind CSS Blog
Forbes - Security
Forbes - Security
F
Full Disclosure
SecWiki News
SecWiki News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Hacker News: Ask HN
Hacker News: Ask HN
C
Check Point Blog
Microsoft Security Blog
Microsoft Security Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
F
Fortinet All Blogs
Cisco Talos Blog
Cisco Talos Blog
G
Google Developers Blog
J
Java Code Geeks
Google DeepMind News
Google DeepMind News
人人都是产品经理
人人都是产品经理
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Recorded Future
Recorded Future
O
OpenAI News
Spread Privacy
Spread Privacy
MongoDB | Blog
MongoDB | Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
C
Cybersecurity and Infrastructure Security Agency CISA
S
Securelist
V
Vulnerabilities – Threatpost
Y
Y Combinator Blog
IT之家
IT之家
U
Unit 42
腾讯CDC
S
Security Affairs
C
Cisco Blogs
Schneier on Security
Schneier on Security
The Last Watchdog
The Last Watchdog
B
Blog RSS Feed
宝玉的分享
宝玉的分享
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
S
Security @ Cisco Blogs
Cyberwarzone
Cyberwarzone
T
The Blog of Author Tim Ferriss

博客园 - 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