Submit A Resource
Contact Us
About Functionn

Subscription Options

Subscribe By Email (265+)



Jun 8, 2012

Author: Hirvesh Posted At: 6/08/2012 Tags: , , ,

crapLoader.js - Loads (Almost) Any Third-Party Script With document.write Asynchronously

crapLoader.js is a JavaScript library to load ads, widgets or any JavaScript code with document.write in it. The recommended solution is to use iframes for third-party content, but this is not always possible. Normally document.write prevents you from loading a script asynchronously, but this library hijacks document.write and delegates the content loaded from each script into the correct position.


  • Load (almost) any third-party script asynchronously
  • Does not block rendering of your page
  • Your visitors see your content earlier
  • DOMContentLoaded (a.k.a. $(doc).ready ) and window.onload triggered earlier
  • Load the banners in parallel! Except in IE ;(
  • Banners loads faster (at least in theory)
  • Handles recursive scripts
  • Inline and external javascript
  • Inline and external vbscript
  • Buffer document.write, flush on script load event
  • Handles document.getElementById from the buffer
  • Tested (manually) in IE 6-10, latest Firefox, Chrome, Safari, Opera


  • You never know for sure that all ads will load correctly
  • Ads might circumvent by getting a clean doc.write from an iframe
  • Possible to stop, but won't
  • Using this script might violate the terms of your ad provider
  • You can't use document.write in your own scripts, but why would you?!?
  • document.getElementById will be a tad slower until all scripts loaded with crapLoader are finished loading

Requirements: None
License: MIT License

Daily Posts, Be Updated, Subscribe:

Want Free Web Resources? Enter Your Email And We'll Send It To You - Daily! (265+ Subscribers)

Yup, it's that straight forward! Enter your email address below and we'll send you the latest web resources to your inbox, everyday. We don't do spam. Ever.

Trending Posts On Functionn This Week


Other Interesting Resources:


  1. Budgetary control is widely used in management
    accounting there are personal income tax projection software no beggars.
    But, I also believe that the personal income tax projection software
    development loan would keep a keen eye on the cash in The Java Lounge's expense accounts
    track things such as rent, hydro, coffee suppliesbeans, milk, sugar, etc.

    Something like that So you're stuck with cash instead oof
    using that cash to grow personal income tax projection software your business.

    Feel free to surf to my blog; Doradca Podatkowy W Bialymstoku (Www.Falkotimme.Com)



Recent Posts

Popular Categories

Popular Components

Popular Licenses