Tuesday, 6 June 2017

Ajax get function with endpoints

I have an endpoint on the server:

app.get('/A/:A_Id/B/:B_Id/C?', callbackFunction);

After I type "http://xx.xx.xx.xx:3000/A/1/B/1/C?startTimeUtc=03:00:00&endTimeUtc=05:00:00" the server responds with data in callbackFunction, I can see the data in address http://xx.xx.xx.xx:3000/A/1/B/1/C?startTimeUtc=03:00:00&endTimeUtc=05:00:00,

but I am not able to get data with an ajax get function:

  $.ajax({
      type: 'GET',
      url: '/A/:A_ID/B/:B_ID/C?', success: function(result){
      // result is NaN
}

What should be the correct endpoint in this case?



via Deidara

No comments:

Post a Comment