title: javascript: ajax call not working
body: <p>I have a javascript file which sends lat and lon to database, calling insertLocation.php</p>
  
  <p>the file path is proj/services/insertlocation (I don't know if I have the right path)</p>
  
  <pre><code>function updateLocation(){
          $.ajax({
              url: '/services/insertLocation.php',
              type: 'POST',
              data: {
                  lat: $lat,
                  lon: $lon,
                  userid: 0
              }
          }).done(function(data){
              alert("data saved");
          });
      }
  </code></pre>
  
  <p>the insertLocation.php works fine when ran independantly</p>
  
  <p>Any ideas?</p>