SWFAddress、后退按钮
当用户按下浏览器后退按钮时,SWFAddress 可以“感知”吗?
我知道它可以触发 EXTERNAL_EVENTS,但是......它对特定按钮执行此操作吗?
Can SWFAddress "sense" when a user has pressed the browser back button?
I know it can fire off EXTERNAL_EVENTS, but...does it do this for specific buttons?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实并非如此,swfaddress 对用户按下后退按钮的唯一感知是浏览器地址栏中的地址发生变化(由 javascript 中的 window.location 对象表示)。它通过定期检查 window.location 对象来检测该更改。
当 window.location 对象发生更改,但 swfaddress 未触发地址更改时,它会触发 EXTERNAL_CHANGE 事件。这可能是由于用户在位置栏中输入新的锚点、点击后退/前进按钮或其他一些原因造成的。没有办法做一些像在浏览器的后退按钮上放置事件侦听器这样的事情。
Not really, the only awareness that swfaddress has of the user pressing the back button is that the address in the browser's location bar changes (represented by the window.location object in javascript). It detects that change by checking the window.location object on a regular interval.
When the window.location object changes, but swfaddress didn't trigger the address change, it fires an EXTERNAL_CHANGE event. This could be caused by the user typing in a new anchor into the location bar, hitting the back/forward buttons, or several other things. There's no way to do something like putting an event listener on the browser's back button.