title: HTML Tag <a> with both href and onclick and AJAX Request
body: <p>I want to have both href and onclick working and I found a solution here:
  <a href="https://stackoverflow.com/questions/14867558/html-tag-a-want-to-add-both-href-and-onclick-working">HTML tag &lt;a&gt; want to add both href and onclick working</a></p>
  
  <p>In myFunction, I make an AJAX Request calling a perl component.</p>
  
  <p>It works fine when I put the Javascript call in href, but not when in onclick. Unfortunately, I'm not allowed this solution neither jQuery, so can you please help.</p>
  
  <pre><code>// AJAX Request doesn't work
  &lt;a href="www.mysite.com" onclick="myFunction();"&gt;Item&lt;/a&gt;
  
  &lt;script type="text/javascript"&gt;
      function myFunction () {
          var xmlHttp = getXMLHttpObject();
          xmlHttp.open('GET', 'perl.m', true);                
          return true;
      }
  &lt;/script&gt;
  
  // AJAX Request ok
  &lt;a href="javascript: myFunction('www.mysite.com')"&gt;Item&lt;/a&gt;
  
  &lt;script type="text/javascript"&gt;
      function myFunction (url) {
          var xmlHttp = getXMLHttpObject();
          xmlHttp.open('GET', 'perl.m', true);
          window.location.href = goto_url;                
      }
  &lt;/script&gt;
  
  perl.m:
  &lt;%init&gt;
      warn "perl.m";
      ... update ...
  &lt;/%init&gt;
  </code></pre>