js 单线程异步测试 浏览器是多线程
原创
©著作权归作者所有:来自51CTO博客作者RandTsui的原创作品,请联系作者获取转载授权,否则将追究法律责任
html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link href="../Content/StyleSheet3.css" rel="stylesheet" />
<script src="../Scripts/JavaScript3.js"></script>
<title></title>
<meta charset="utf-8" />
</head>
<body>
<p id="p1">as</p>
<p id="p2">as</p>
</body>
</html>
js
window.onload = function () {
setTimeout(p1fun,5000);
document.getElementById("p2").innerText = "我是p2";
};
var p1fun = function () {
document.getElementById("p1").innerText = "我是p1";
};
css
无