gpt4 book ai didi

jquery - Safari Mobile 中的 JavaScript 卸载事件?

转载 作者:行者123 更新时间:2023-12-01 01:04:38 27 4
gpt4 key购买 nike

我正在使用 jQtouch 和 jQuery 开发一个适用于 iPad 的网络应用程序。该网络应用程序在商店中使用,并通过 AVD 浏览器进行查看,当设备震动或断电时,AVD 浏览器会向我发送电子邮件警报。不过,我也想知道 webapp 何时关闭。我尝试使用 $(window).bind('unload', function(){});但它在 Safari Mobile 和 AVD 浏览中都不起作用。我怎样才能让它工作?

最佳答案

我有一个答案。这不是我们所希望的。

http://www.w3.org/TR/DOM-Level-2-Events/events.html 卸载的技术定义是:

The unload event occurs when the DOM implementation removes a document from a window or frame. This event is valid for BODY and FRAMESET elements.

我还收到了 Apple 一些知情人士的回复:“不幸的是,我无法找到单击 Home 按钮时触发的事件!我认为最合适的事件可能是 pagehide事件。实际上,当您切换到“选项卡” View 以打开新页面时,iOS 上的 Safari 中会触发此事件,但当您单击主屏幕图标时不会触发:-("

关于jquery - Safari Mobile 中的 JavaScript 卸载事件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4520143/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com