js lazy loader written in Javascript