test-dep-extractor-cli
Version:
30 lines (29 loc) • 1.8 kB
HTML
<html><head>
<title>静态资源加载测试</title>
<meta charset="utf-8">
<meta id="viewport" name="viewport" content="width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1, maximum-scale=1" ratio="1">
<script type="text/javascript">
window.failList = [];
window.successList = [];
</script>
<link href="//res.wx.qq.com" rel="stylesheet" type="text/css" onload="window.successList.push(this.href)" onerror="window.failList.push(this.href)"><link href="//mmbiz.qpic.cn" rel="stylesheet" type="text/css" onload="window.successList.push(this.href)" onerror="window.failList.push(this.href)"><link href="//res.wx.qq.com/mmbizwap/zh_CN/htmledition/images/icon/common/favicon22c41b.ico" rel="stylesheet" type="text/css" onload="window.successList.push(this.href)" onerror="window.failList.push(this.href)"><script src="https://res.wx.qq.com/mmbizwap/zh_CN/htmledition/js/biz_common/jquery.md53518c6.js" onload="window.successList.push(this.src)" onerror="window.failList.push(this.src)" type="text/javascript"></script></head>
<body onload="log()" style="font-size:20px;">
<ul id="failList" style="color:red;list-style-type:square;"></ul>
<ul id="successList" style="list-style-type:circle;color:green"></ul>
<script type="text/javascript">
function log() {
window.failList.forEach(function (url) {
append(url, 'fail')
});
window.successList.forEach(function (url) {
append(url, 'success')
});
}
function append(content, mode) {
var list = document.getElementById((mode == 'success') ? 'successList' : 'failList');
var li = document.createElement('li');
li.innerHTML = content;
list.appendChild(li);
}
</script>
</body></html>