title: make jquery function available only when the page is ready
body: <p>Is it possible to make a function available after the DOM is ready only? For example something like this</p>
  
  <pre><code>$(document).ready(function(){
  
  function open(obj)
  {
  
  }
  });
  
  &lt;a href="#" onclick="open(this);"&gt;test&lt;/a&gt;
  </code></pre>
  
  <p>If I do that clicking on <code>a</code> doesn't do anything at all, and if I have the function without the <code>document.ready</code>, when user clicks on the link while the page is loading, it doesn't display properly.</p>
  
  <p>Thank you</p>