<!DOCTYPE html>
<html manifest="example.appcache">
<head>
<meta charset="utf-8">
<title>回调函数</title>
<link rel="stylesheet" href="css/Alert.css"/>
<link rel="stylesheet" href="css/confirm.css"/>
<script src="js/Alert.js"></script>
<script src="js/confirm.js"></script>
</head>
<body>
<p>删除</p>
<p>删除</p>
<script>
var a = ['1','20','2','30'];
console.log(a.slice('1'));
var ps = document.querySelectorAll('p')
console.log(Array.call(ps));
Array.prototype.slice.call(ps).forEach(function (p) {
p.onclick = function () {
new Confirm('确定要删除此段落吗?',function () {
p.remove()
new Alert('已删除!').show()
},
function () {
new Alert('已取消删除').show()
}).show()
}
})
</script>
</body>
</html>
这下面是缓存清单:
CACHE MANIFEST
v1 2017-04-06
This is another comment
index.html
css/Alert.css
css/confirm.css
js/Alert.js
js/confirm.js
Use from network if available
NETWORK:
*
Fallback content
FALLBACK:
*这是mime类型
这是控制台输出;
当我第一次打开请求加载完毕时,我把css/js 请求状态码为200 ,第二次还是200,不应该是304重定向到缓存吗?
demo是放在iis里,第二次加载的时候,我把head中引入的js、css文件删除不是应该正常显示吗?