---
title: Non-Blocking Javascript
date: 2014-08-26T17:58:51+00:00
modified: 2014-08-26T17:58:51+00:00
permalink: https://kaspars.net/blog/non-blocking-javascript
post_type: post
author:
  name: Kaspars
  avatar: https://reverse.kaspars.net/gravatar/avatar/92bfcd3a8c3a21a033a6484d32c25a40b113ec6891f674336081513d5c98ef76?s=96&d=mm&r=g
category:
  - Development
  - Web Performance
post_format:
  - Aside
---

# Non-Blocking Javascript

Today I learned that using [inline anonymous function to add Javascript files to DOM will block the `onload` event](http://friendlybit.com/js/lazy-loading-asyncronous-javascript/) until the referenced script is fully loaded. The solution is to attach the function which adds the &lt;`script>` element to the `onload` event.