title: Using jQuery code to replace my javascript XMLHttpRequest
body: <p>I am kind of new to JavaScript library's. I wanted to replace my current code with a JS lib jQuery. My current code looks like this.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function myajax() 
    {
    var xmlhttp = new XMLHttpRequest();
    var url = "http://localhost:8080/Marker1/webresources/org.sample.marker/markerlist";
    xmlhttp.onreadystatechange = function () {
        if (xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200) 
     {
     myFunction(xmlhttp.responseText);
        }
    };
    xmlhttp.open("GET", url, true);
    xmlhttp.send();
       }
      function myFunction(data) {
              myArr = JSON.parse(data);   // parsing JSON
   updateMap(data);   
      }</code></pre>
  </div>
  </div>
  </p>