title: How to make AJAX call from jquery mobile to ASP.NET Webservice
body: <p>I have created an android application using (Jquery &amp; PhoneGap). The application works fine Now, I want to retrieve data from my ASP.NET Web Service.  </p>
  
  <p>html:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;My Friends&lt;/title&gt;
  
      &lt;link href="Jquery-mobile/jquery.mobile-1.1.0.css" rel="stylesheet" type="text/css" /&gt;
      &lt;script src="Jquery-mobile/jquery-1.4.1.js" type="text/javascript"&gt;&lt;/script&gt;
  
      &lt;script src="Jquery-mobile/jquery.mobile-1.1.0.js" type="text/javascript"&gt;&lt;/script&gt;
       &lt;script type="text/javascript"&gt;
  
  
          $(function(){
               //code to fetch data from webservice  
  
               alert($("#test").html());
          });
      &lt;/script&gt;
  
    &lt;/head&gt;
    &lt;body&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>asp.net web service</p>
  
  <pre><code>/// &lt;summary&gt;
      /// Summary description for WebService1
      /// &lt;/summary&gt;
      [WebService(Namespace = "http://tempuri.org/")]
      [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
      [System.ComponentModel.ToolboxItem(false)]
      // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
      // [System.Web.Script.Services.ScriptService]
      public class WebService1 : System.Web.Services.WebService
      {
  
          [WebMethod]
          public string HelloWorld()
          {
              return "Hello World";
          }
      }
  </code></pre>