This is a shortcut for $(document).ready()
, which is executed when the browser has finished loading the page (meaning here, "when the DOM is available"). See http://www.learningjquery.com/2006/09/introducing-document-ready. If you are trying to call example()
before the browser has finished loading the page, it may not work.