karthika pommudu

karthika pommudu

  • 1.6k
  • 243
  • 5.2k

Urgent...How to call ajax with multiples of value in json

Mar 20 2019 12:38 AM
How can I call the multiples of value from this query.php,here I got a single value from query.php,but when the multiple values pass means have a issue that mean it's can't read the function
 
Ajax function:(test.php)
  1. $.ajax({  
  2. url: "query.php",  
  3. cache: false,  
  4. dataType:'json',  
  5. //data: {registration_no: registration_no, latitude : latitude},  
  6. success: function(data) {  
  7. // alert(data.latitude);  
  8. $('#latitude').html(data.latitude);  
  9. $('#longitude').html(data.longitude); $('#speed').html(data.speed);  
  10. var latitude = data.latitude;  
  11. var longitude = data.longitude;  
  12. var speed = data.speed;  
  13. var locations=[latitude,longitude];  
  14. allload(latitude,longitude);  
  15. }});
values from query.php
 
{"latitude":"10.969470","longitude":"79.397572","speed":"0.00"}{"latitude":"8.754737","longitude":"78.191653","speed":"0.00"}{"latitude":"8.754737","longitude":"78.191653","speed":"1.00"}{"latitude":"8.754743","longitude":"78.191617","speed":"0.00"}{"latitude":"8.754747","longitude":"78.191580","speed":"5.00"}

Answers (2)