JRu*_*ulz 4 html javascript jquery html5 html5-appcache
我想在运行时添加manifest属性,因此我可以控制何时下载Appcache.
例如:当用户正确登录应用程序时,
<html>
// page content
</html>
Run Code Online (Sandbox Code Playgroud)
变成:
<html manifest="myapp.manifest">
// page content
</html>
Run Code Online (Sandbox Code Playgroud)
无论如何我可以使用javascript,jquery或其他任何东西实现这一点吗?我想要的是控制何时有条件地下载Appcache.(我已经读过在iFrame中有另一个html.)
根据规范,manifest在加载文档后更改属性无效.
您仍然可以html通过以下方式访问元素并更改属性值document.documentElement:
document.documentElement.setAttribute('manifest', 'myapp.manifest');
Run Code Online (Sandbox Code Playgroud)
它不会做任何事情.