【发布时间】:2021-02-23 00:29:39
【问题描述】:
我写了一个html页面,代码如下。
<html>
<header>
<div class="logo"><a href="index.html" title="Coyle Appliance Repair"></a></div>
<div class="phoneNumber"><h3 class="numberHeader">call today for an appointment - same day service is available</h3>
<h1 class="number"><a href="tel:+1-555-555-5555">555-555-5555</a></h1></div>
<div class="greyStrip"><h2 class="motto">Serving the Twin Cities and western Wisconsin since 1982</h2></div>
</header>
<script>
((function demo () {
let a = 1
while (a < 10000) {
a++
console.log(a)
}
})())
</script>
<div class="mainContent"><h2 class="missionStatement">Full service restaurant and commercial kitchen repair. We service all cooking, food prep, warewash/dishroom, and
refrigeration equipment.</h2>
</div>
</html>
问题是,console.log(a)的代码保留和删除有什么区别
- 当我删除它时,页面将流畅地显示,没有阻塞或闪烁。
- 但是当我添加这个控制台时,页面会阻塞一段时间或闪现。
【问题讨论】:
标签: javascript html web-performance