title: Calling ASMX from jQuery
body: <p>I am trying to call an ASMX method from jQuery without success. Following is my code, and I don't understand what I am missing.</p>
  
  <p>File Something.js,</p>
  
  <pre><code>function setQuestion() {
      $.ajax({
          type: "POST",
          data: "{}",
          dataType: "json",
          url: "http: //localhost/BoATransformation/Survey.asmx/GetSurvey",
          contentType: "application/json; charset=utf-8",
          success: onSuccess
      });
  }
  
  function onSuccess(msg) {
      $("#questionCxt").append(msg);
  }
  </code></pre>
  
  <p>File SomethingElse.cs,</p>
  
  <pre><code>[WebService(Namespace = "http://tempuri.org/")]
  [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
  [System.Web.Script.Services.ScriptService]
  public class Survey : System.Web.Services.WebService {
  
      public Survey () {
      }
  
      [WebMethod]
      [ScriptMethod(UseHttpGet = true)]
      public string GetSurvey() {
          return "Question: Who is Snoopy?";
      }
  }
  </code></pre>