en.javascript.info/1-js/2-first-steps/2-external-script/2-async-defer-first/task.md
2015-01-21 11:37:57 +03:00

27 lines
633 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Какой скрипт выполнится первым?
[importance 4]
В примере ниже подключены два скрипта `small.js` и `big.js`.
Если предположить, что `small.js` загружается гораздо быстрее, чем `big.js` -- какой выполнится первым?
```html
<script src="big.js"></script>
<script src="small.js"></script>
```
А вот так?
```html
<script async src="big.js"></script>
<script async src="small.js"></script>
```
А так?
```html
<script defer src="big.js"></script>
<script defer src="small.js"></script>
```