1

Simple question.. if I have on my page:

<link .. with href to some css>
<script.. with src to some script>

can I expect that css will be loaded in page before script loaded and executed, or they can be loaded in parallel?

David
  • 208,112
  • 36
  • 198
  • 279
WHITECOLOR
  • 24,996
  • 37
  • 121
  • 181
  • possible duplicate of [How to define priority to load resources on the webpages?](http://stackoverflow.com/questions/5178863/how-to-define-priority-to-load-resources-on-the-webpages) – David Dec 13 '11 at 17:01

2 Answers2

2
  1. The CSS will start load and parse, The the script will start load and parse.
  2. Then the script will execute after the load/parse is complete.
Mark Schultheiss
  • 32,614
  • 12
  • 69
  • 100
1

CSS will start loading before the script but loading will be asynchronous. So, you can't be sure which one will be loaded first (depending on the size and internet connection status at that moment) but both of them will be loaded when you reach the onLoad() event.

Emir Akaydın
  • 5,708
  • 1
  • 29
  • 57