Answer the question
In order to leave comments, you need to log in
how to get json on iphone
I use Yandex to get a list of cities and paste it on the page.
For example, if you enter "Mo", then json will be returned with a list of all cities in which there is Mo.
I do it like this:
$(document).on('input paste','.adres_delivery', function() {
$('.list_adres').html('');
$.getJSON('http://geocode-maps.yandex.ru/1.x/?format=json&geocode='+$(this).val(), function(data){
var items = [];
$.each(data.response.GeoObjectCollection.featureMember, function(key, val){
$('.list_adres').append('<li administrative="'+val.GeoObject.metaDataProperty.GeocoderMetaData.AddressDetails.Country.AdministrativeArea.AdministrativeAreaName+'" class="open_delivery" pos="'+val.GeoObject.Point.pos+'">'+val.GeoObject.metaDataProperty.GeocoderMetaData.text+'</li>');
$('.list_adres').show();
});
});
});
Answer the question
In order to leave comments, you need to log in
Can't figure it out without debugging. Connect your phone to your computer and see what's going on in the console.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question