jQuery.ajax() not firing
<p>I used Firebug to debug my code. In the "Net" panel, I don't see the <code>.ajax()</code> firing at all. (didn't see any outgoing request url)</p>

<p>What is wrong with my code?</p>

<p><em><strong>Edited: After i added  $(document).ready(). to my code, everything just works fine. Why do I need $(document).ready() ?
I thought when the button is clicked, the document is ready for sure.
Needed to add "return false;" as well</em></strong></p>

<pre><code>function doSubmit() {
        alert('button is clicked.');

        $.ajax({
          type: 'Post',
          url: "http://mysite.com/list/json",
          dataType: "json",
          context: [],
          success: function(data){
              alert('got data');
          }
        }); 
}       
</code></pre>



<pre><code>&lt;form name="my_form" id="myform"&gt;
    &lt;div class="mydiv"&gt;
        &lt;input class="button" type="submit" value="Save" onClick="doSubmit();"&gt;
    &lt;/div&gt;
&lt;/form&gt;
</code></pre>
