title: jquery Ajax Request SyntaxError: Unexpected token <
body: <p>I am trying to return an array of products using a get request. The response returns XML with a 200 request. </p>
  
  <p>Web Service:</p>
  
  <pre><code>[WebMethod]
  [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]
  public List&lt;product&gt; GetAllProducts()
  {
      using (SchulteDesignYourOwnEntities db = new SchulteDesignYourOwnEntities())
      {
          return db.products.ToList();
      }
  }
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  
      &lt;head&gt;
          &lt;title&gt;&lt;/title&gt;
          &lt;script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.3.min.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript"&gt;
              $(document).ready(function () {
  
                  $.ajax({
                      url: 'http://www.organizeliving.com/designwebservice.asmx/GetAllProducts',
                      dataType: 'json',
                      success: function (result) {
                          alert("Result: " + result.length);
                      },
                      error: function (xhr, ajaxOptions, thrownError) {
                          console.log("Status: " + xhr.status);
                          console.log("Message: " + thrownError);
                      }
                  });
  
  
              });
          &lt;/script&gt;
      &lt;/head&gt;
  
      &lt;body&gt;&lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>