有两个页面A和B。页面A是普通的Html页面,而页面B是使用Cache Manifest的Html页面。
任务:如果互联网连接不可用,页面 A 重定向到页面 B。
问题:由于重定向使用 HTTP 请求,因此未加载页面 B,显示无互联网连接
有什么方法可以从页面 A 重定向到页面 B?
最佳答案
您是否尝试在 list 中提供 FALLBACK
header ?
# Fallback content
FALLBACK:
. example.html
If the (request) attempt fails, due to either a network failure or a server error of some kind, the browser loads the file example.html instead.
https://developer.mozilla.org/en-US/docs/Web/HTML/Using_the_application_cache
关于javascript - 无互联网连接时重定向到缓存页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48249839/