-
Notifications
You must be signed in to change notification settings - Fork 8
rule script in tail
Hanxing Yang edited this page Jul 10, 2016
·
3 revisions
script-in-tail
All JavaScript content (<script>
or <script type="text/javascript">
) are recommended to be imported in the tail of <body>
, which may improve the first-screen performance. If found not, it reports.
<!-- Bad -->
<head>
<meta charset="UTF-8">
<title>sample</title>
<script src="test.js"></script>
<script>
alert('!');
</script>
</head>
<body>
<script src="test.js"></script>
<script>
alert('!');
</script>
<div>
<script src="test.js"></script>
<script>
alert('!');
</script>
</div>
</body>
<!-- Good -->
<body>
<script src="test.js"></script>
<script>
alert('!');
</script>
</body>
-
023
<script>
or<script type="text/javascript">
found not in the tail of<body>
.
-
true
Do check / format.
-
false
Do not check / format.
No.