1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
(function(){
  var formFunc = function($) {
    // Magical DOM stuff here...
  }

  // Asynchronous Javascript programming!
  setTimeout(function check() {
    if(typeof jQuery == 'function') {
      console.log("formFunc");
      formFunc(jQuery);
    } else {
      setTimeout(check, 100);
    }
  }, 100);
}).call(this);