jQuery Mobile - 不带“/index.html”的基本 URL和离线访问

发布于 2024-12-18 15:45:49 字数 439 浏览 2 评论 0原文

下访问应用程序,例如 http://somedomain.com/

如何仅使用基本域 URL 在离线模式 我在线,一切正常,服务器自动将其重定向到index.html。问题是,在缓存清单中仅提供了确切的文件“index.html”,因此在离线模式下我只能访问 http ://somedomain.com/index.html,它被缓存并存在,但不像 http://somedomain.com /,因为服务器不可用,我什至无法做到javascript重定向,因为没有入口文件。

请帮忙解决这个问题。

How to get access to app in offline mode using just base domain URL, for example http://somedomain.com/

When i'm online everything is ok, server redirects it to index.html automatically. Problem is that in cache manifest provided only exact file "index.html", so in offline mode i can only get access to http://somedomain.com/index.html, it's cached and exist, but not as http://somedomain.com/, because server is not available and i even can't do javascript redirect, coz there is no entrance file.

Please help to solve this.

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

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

发布评论

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

评论(1

浪菊怪哟 2024-12-25 15:45:49

您需要在清单文件中设置 FALLBACK 部分 - 它将在离线时将任何请求重定向到某个文件,例如:

FALLBACK:
//index.html

一些更多详细信息

希望这会有所帮助...

PS:如果这对您有用,请标记为答案!

You need to setup the FALLBACK section in your Manifest file - that will redirect ANY requests while offline to a certain file, e.g:

FALLBACK:
/ /index.html

Some more details

Hope this helps...

PS: Please mark as Answer if this worked out for you!

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