title: Uncaught SyntaxError: Unexpected token < -- in jQuery ajax
body: <p>I am new to web service. In my project, I connected Web Service(everything is ready-made) now when I tried to run I got the below error.</p>
  
  <p>ERROR --></p>
  
  <blockquote>
    <p><code>Uncaught SyntaxError: Unexpected token &lt;</code></p>
  </blockquote>
  
  <p>The Web service and my page are in same solution but different projects.</p>
  
  <p>The related code is as follows:</p>
  
  <p><strong>jQuery</strong>  (URL: 11761)</p>
  
  <pre><code> function GetAllCategories() {
     $.ajax({
        url: "http://localhost:12015/myWebService.asmx?op=GetCategories",
        type: "POST",
        dataType: "jsonp",
        data: "{}",
        contentType: "application/jsonp; charset=utf-8",
        success: function (data) {
            var categories = data.d;
            $.each(categories, function (index, category) {
                alert(category.CategoryId);
            });
        },
        error: function (e) {
            alert(e.message);
        }
     });
  }
  </code></pre>
  
  <p><strong>Web Service</strong> (URL: 12015)</p>
  
  <pre><code>[WebMethod]
  [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
  public List&lt;Categories&gt;  GetCategories()
  {
      //Code
  }
  </code></pre>
  
  <p>Before asking here I have gone through this <a href="https://stackoverflow.com/a/3153134/1577396">link</a>(cant understand it)</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Got alternative answer from this <strong><a href="https://stackoverflow.com/a/14122895/1577396">post</a></strong>.</p>