javascript - Practically using script async or defer with frameworks like angular -


have been studying use of async , defer in script tags. given following...

async - allows rest of html parse, while js script being loaded. once script loaded html parser paused execute script. however, note order of loading can't controlled.

defer - allows rest of html parse, loaded js executed once html parsing complete.

so, if can afford show html without loading js script first... use async. if more 1 script involved , order loaded matters use defer. on other hand, if scripts must loaded first (and can't rewritten allow html parse first) load script without using async or defer in header.

how fit modern frameworks angularjs... since, delaying loading results in error. pointers appreciated.


Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -