Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

About this user

Winton Welsh http://stu.dicio.us

« Newer Snippets
Older Snippets »
1 total  XML / RSS feed 

Loader

// use Loader.addOnLoad(function) to add onload events

var Loader = {
  loaded: false,
  addOnLoad: function(fn) {
    if (this.loaded) fn();
    else {
      var oldonload = (window.onload) ? window.onload : function () {};
      window.onload = function () { oldonload(); fn(); };
    }
  },
  init: function() {
    this.loaded = true;
  }
};
Loader.addOnLoad(Loader.init);
« Newer Snippets
Older Snippets »
1 total  XML / RSS feed