title: jQuery call user defined function on load
body: <pre><code>$(document).ready(function(){
  
  $.fn.newQsNum = function(){
      var num_of_qs = 5;
      return Math.floor(Math.random()*num_of_qs)+1
  }
  
  });
  
  $(window).load(newQsNum);
  </code></pre>
  
  <p>how do you call a user defined function on windows load?
  when i looked at the error console, it says the newQsNum is undefined.
  have i done anything wrong? i just followed</p>
  
  <p><a href="http://jquery-howto.blogspot.com/2008/12/how-to-add-your-own-custom-functions-to.html" rel="nofollow">http://jquery-howto.blogspot.com/2008/12/how-to-add-your-own-custom-functions-to.html</a> </p>