因为浏览器在加载js时会耗费时间,并且加载完成后会立即执行,当执行时其它资源有可能还未就绪,所以一般都会放在后面,保证第一屏界面迅速加载并呈现给访问者。
<!DOCTYPE html> <html> <head> <title>Workdays</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link rel="shortcut icon" href="/static/img/icon.png" type="image/x-icon" /> <link href="/static/lib/pure/1.0.0/pure-min.css" rel="stylesheet" type="text/css"> <link href="/static/css/index.css?v=1" rel="stylesheet" type="text/css"> </head> <body> <header> ... </header> ... <footer> ... </footer> <!-- start --> <script type="text/javascript" src="/static/lib/require/require.js"></script> <!-- common --> <!-- modules --> <!-- special --> </body> </html>