title: loading a function onclick
body: <p>I have the following piece of code</p>
  
  <pre><code>&lt;a onclick="$('#result').load('codes/test.html');$('#result').show();" &gt;XHTML code&lt;/a&gt;
  </code></pre>
  
  <p>it loads perfectly the content of test.html in the result div and also make it visible. Until this point all are good. When I try to add a function <code>prettyPrint()</code> which apply some modifications on the text and change the code to the following:</p>
  
  <pre><code>&lt;a onclick="$('#result').load('codes/test.html');$('#result').show();prettyPrint();" &gt;XHTML code&lt;/a&gt;
  </code></pre>
  
  <p>I can't make the prettyPrint() to work, instead if I add <code>onmouseout="prettyPrint();</code> it works when I take off my cursor. I don't have experience with javascript and jquery so I don't know what is the real problem, so I would appreciate any help on how to  make prettyPrint to work <code>onclick</code>.</p>