i have a latitude and longitude of particular user in db .. i am getting the values by using jquery .. here is what i am doing
var auto_refresh = setInterval(
function ()
{
$.get('http://localhost/Location/locate', function(data){
$('.latitude').html(data.lat);
$('.longitude').html(data.long);
}, 'json');
}, 1000);
when i was getting the location from php i was doing this
'localize' => false,
'latitude' => $latitude,
'longitude' => $longitude,
'address' => $address,
'marker' => true,
now i am doing this but is giving me syntax error
'latitude' => ?><div class = 'latitude'></div><?php ,
'longitude' => ?><div class = 'longitude'></div><?php ,
and the other thing i like to ask is that is this the best approach for getting the location without page refresh .. or there is something else too .