Rails redirect_to jQTouch 站点无法按预期工作

发布于 2024-08-31 08:51:33 字数 354 浏览 2 评论 0原文

我有一个带有 jQ​​Touch 移动站点的 Rails 应用程序,如果用户访问 m.blah.com,就会显示该站点。首先,我检测浏览器,然后重定向到 m.blah.com(如果是 iPhone)等。一切都很好。当我使用桌面版 Safari 时,一切都正常。

然而,当我使用实际的 iPhone 或 Apple iPhone 模拟器时,却没有。移动网站似乎可以加载,而浏览器实际上并没有进行重定向。浏览器中的URL仍然是www。

我想知道这种行为是否是由于 Mobile Safari 造成的,或者是否是 jQTouch 尝试使用 AJAX 加载页面,而不是重新加载(这很奇怪,因为 jQTouch 在重定向之前根本没有加载)。

有什么想法吗?

I have a Rails app with a jQTouch mobile site that is displayed if the user goes to m.blah.com. First, I detect the browser, then to a redirect_to m.blah.com if it's an iphone, etc. All well and good. When I use desktop Safari, this all works exactly right.

However, when I use an actual iPhone or the Apple iPhone Simulator, it does not. The mobile site appears to load without the browser actually doing the redirect. The URL in the browser is still www.

I am wondering if this behavior is due to Mobile Safari, or if it is somehow jQTouch trying to load the page with AJAX, not a reload (which is odd as jQTouch hasn't been loaded at all before the redirect).

Any ideas?

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

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

发布评论

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

评论(1

沫雨熙 2024-09-07 08:51:33

我们也遇到过类似的问题。大多数时候,您可以通过添加 :rel => 来强制重定向。重定向到或 Link_to 调用的“外部”参数。还没有完全弄清楚何时需要这样做,但它似乎解决了我们与死链接有关的大多数问题。

We've experienced similar issues. Most of the time you can force the redirect by adding the :rel => "external" param to the redirect_to or Link_to call. Haven't quite sorted out exactly when this is required but it seems to resolve the majority of issues we have with dead links.

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