jQuery Mobile - 不带“/index.html”的基本 URL和离线访问
下访问应用程序,例如 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要在清单文件中设置 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!