title: javascript function gets called twice
body: <p>I am trying to call a javascript function on clicking a link. Actually i want to submit a form on clicking a link using post method so i am trying to do the below-</p>
  
  <pre><code>&lt;a href="javascript:submitCategory(this)" &gt;Handicrafts&lt;/a&gt;
  </code></pre>
  
  <p>and in javascript</p>
  
  <pre><code>function submitCategory(varthis)
  {   
      alert(varthis.value);
  }
  </code></pre>
  
  <p>I have few important questions:
  1>When i click on the link the function submitCategory gets called twice. After much analysis found that i had two js files included and removing one of them made the function getting called only once.
   meaning
   when i have included </p>
  
  <pre><code>&lt;script type ="text/javascript" src="jquery.js"&gt;&lt;/script&gt;
      &lt;script type ="text/javascript" src="cWed.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>submitCategory function gets called twice</p>
  
  <p>and when i remove one of them and include</p>
  
  <pre><code>&lt;script type ="text/javascript" src="jquery.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>submitCategory function gets called only once.</p>
  
  <p>Why is it like this?</p>
  
  <p>2> alert(thisvar.value) should return Handicrafts but it returns undefined. why could this be?</p>
  
  <p>3>what exactly is the meaning of href="javascript:submitCategory(this)"? i have not come across this in any tutorial. and including this here should refer to the element "a" right?</p>