title: Rewrite Javascript to jQuery with Ajax
body: <p>I'm totally new to jQuery and I need to rewrite this bit of javascript to jQuery. Can you help me out? Is this correct?</p>
  
  <p>Javascript:</p>
  
  <pre><code>var xmlHttpRequest = new XMLHttpRequest();
  
  function getTasks(){
  var name=document.getElementById("name").value;
  var summary=document.getElementById("summary").value;
      if (xmlHttpRequest.readyState==4 &amp;&amp; xmlHttpRequest.status==200)
          {
              document.getElementById("open").innerHTML=xmlHttpRequest.responseText;
          }
    xmlHttpRequest.open("Post","jsontaskmanager?name=" + name + "&amp;summary=" + summary, true);
    xmlHttpRequest.send();
  }
  </code></pre>
  
  <p>jQuery:</p>
  
  <pre><code>var xmlhttp = new XMLHttpRequest();
  
  $("document").ready(function(){
      var name = $("name").val();
      var summary = $("summary").val();
      //blah
      $.ajax({
          url: "jsontaskmanager",
          type: "POST",
          dataType: "json",
          data: { name: name, summary: summary },
          success: function(response) {
              $("open").html(response);
          }
      });
  });
  </code></pre>