title: create a web service from a html page: client side, how can i get result and not the code souce of the page
body: <p>I'm trying to do the following thing:
  I wanted to get two dynamic data (latitude and longitude) from a page.html  located in a web server I want to get them as a web service:
  Here is the result of the execution of my web page situated in the server:
  {"results": [{"Latitude": "36.81881", "Longitude": "10.16596"}]}
  And that is exactly what I wanted to recover in my client application but the problem is that I can’t get the result, I can only get the code source of the page. Html located in the server.
  Here is the method that I used on the client to get data from server :</p>
  
  <pre><code>function latLong()
  {
  
      var ajax = new XMLHttpRequest();
  ajax.open("GET","http://localhost/AtitLongiWebService.html",true);
  ajax.send();
  ajax.onreadystatechange=function(){
       if(ajax.readyState==4 &amp;&amp; (ajax.status==200||ajax.status==0)){
       alert(ajax.responseText);    
   }
       }
  }
  </code></pre>
  
  <p>Here is my page.html in the web server:</p>
  
  <pre><code>&lt;!--
  To change this template, choose Tools | Templates
  and open the template in the editor.
  --&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;&lt;/title&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
   &lt;script type="text/javascript"&gt;
  
      function startWatch(){
        if (navigator.geolocation)
          var watchId = navigator.geolocation.watchPosition(successCallback,
                                    errorCallback,
                                    {enableHighAccuracy:true,
                                    timeout:10000,
                                    maximumAge:0});
        else
          alert("Votre navigateur ne prend pas en compte la géolocalisation HTML5");
      }
  
      function stopWatch(){
        navigator.geolocation.clearWatch(watchId);
      }     
  
      function successCallback(position){
        document.getElementById("lat").innerHTML = position.coords.latitude;
        document.getElementById("long").innerHTML = position.coords.longitude;
      };  
  
      function errorCallback(error){
        switch(error.code){
          case error.PERMISSION_DENIED:
            alert("L'utilisateur n'a pas autorisé l'accès à sa position");
            break;      
          case error.POSITION_UNAVAILABLE:
            alert("L'emplacement de l'utilisateur n'a pas pu être déterminé");
            break;
          case error.TIMEOUT:
            alert("Le service n'a pas répondu à temps");
            break;
          }
      };
  
    &lt;/script&gt;
      &lt;/head&gt;
      &lt;body onload="startWatch()"&gt;
  
          {"results":[{"Latitude":"&lt;label id="lat"&gt;&lt;/label&gt;",
          "Longitude": "&lt;label id="long"&gt;&lt;/label&gt;"}]}
  
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Usually ajax.responseText returns the result but in this case it returns the code source, can someone help me to get the result of the execution of the page and not the code source. Thank you for your help.</p>