title: How Retrieve Sharepoint List data using Jquery
body: <p>I am trying to retrieve list data using Jquery. But I am getting the whole list Html page not the values from the List.
  Jquery Code is as follows</p>
  
  <pre><code>&lt;script src="../_layouts/15/SharePointProject1/Scripts/jquery-1.3.2.js"&gt;&lt;/script&gt;
  &lt;script language = "javascript" type="text/javascript"&gt;
      function GetAnnouncementData() {
          var soapPacket = "&lt;soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'&gt; \
     &lt;soapenv:Body&gt; \
      &lt;GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'&gt; \
       &lt;listName&gt;Temp&lt;/listName&gt; \
       &lt;viewFields&gt; \
        &lt;ViewFields&gt; \
          &lt;FieldRef Name='Title' /&gt; \
        &lt;/ViewFields&gt; \
       &lt;/viewFields&gt; \
      &lt;/GetListItems&gt; \
     &lt;/soapenv:Body&gt; \
    &lt;/soapenv:Envelope&gt;";
          jQuery.ajax({
              url: "http://serverName/Lists/Temp/listsView.aspx",
              type: "POST",
              dataType: "xml",
              data: soapPacket,
              complete: processResult,
              contentType: "text/xml; charset=\"utf-8\""
          });
      }
  
      function processResult(xData, status) {
          //jQuery(xData.responseXML).find("z\\:row").each(function () {
          //    $("&lt;li&gt;" + $(this).attr("ows_Title") + "&lt;/li&gt;").appendTo("#AnnouncementData");
          //});
          //alert($(this).attr("ows_Title"));
          alert(xData.responseText);
          //alert(status.toString());
          document.getElementById("tarea").value = xData.responseText;
          document.getElementById("div1").innerHTML = xData.responseText;
      }
      $(document).ready(function () {
          GetAnnouncementData();
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>This code is giving me The list page not list data. I tried to get xml file in div tag so that I can view what it is returning me. It returns me the HTML page of that list.<br>
  Please Help.</p>