Base

Loader.js

Adds a spinner class to the body if the DOMContentLoaded is not fired for 500 ms. The timeout prevents seeing a spinner on an already visited page. Should be included in the head part of the html. It's a self invoking funciton so does not need initialization.

Usage

<script src="js/base/loader.js"></script>

Caller

This file doesn't need a caller, it is self invoking.