iscroll 链接打开新的 Safari 窗口?

发布于 2024-12-17 13:18:22 字数 166 浏览 2 评论 0原文

我使用 iscroll 因为它具有固定页眉/页脚的强大功能。

我在页脚有链接。在正常的野生动物园中,一切正常。当 web 应用程序保存到主屏幕,然后启动时,单击链接后,它们会关闭 web 应用程序并启动 safari。

我尝试过 AJAX 但运气不佳。

有人可以帮忙吗?

I'm using iscroll because of its great features of fixed header/footer.

I have links in the footer. When in normal safari, it all works fine. When the webapp is saved to the home screen, and then launched, after a link is clicked they close the webapp and launch safari.

I've tried AJAX with no good luck.

Can someone please help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

深陷 2024-12-24 13:18:22

这不是 iScroll 造成的,所有网络应用程序在全屏模式下都有相同的行为。用这个脚本就可以轻松解决。它被缩小了,我不记得原始来源在哪里,但它效果很好。我相信它将 href 更改为 onclick 。

<script type="text/javascript">(function(a,b,c){if(c in b&&b[c]){var d,e=a.location,f=/^(a|html)$/i;a.addEventListener("click",function(a){d=a.target;while(!f.test(d.nodeName))d=d.parentNode;"href"in d&&(d.href.indexOf("http")||~d.href.indexOf(e.host))&&(a.preventDefault(),e.href=d.href)},!1)}})(document,window.navigator,"standalone")

This isn't due to iScroll, it's the same behavior in all web apps in full screen mode. Can easily be solved with this script. It's minified, and I don't remember where the original source is, but it works great. I believe it changes href's to onclick's.

<script type="text/javascript">(function(a,b,c){if(c in b&&b[c]){var d,e=a.location,f=/^(a|html)$/i;a.addEventListener("click",function(a){d=a.target;while(!f.test(d.nodeName))d=d.parentNode;"href"in d&&(d.href.indexOf("http")||~d.href.indexOf(e.host))&&(a.preventDefault(),e.href=d.href)},!1)}})(document,window.navigator,"standalone")

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文