someButton.onclick = function() {
fetch(serverUrl).
then(function(response){
console.log('success');
});
};
fetch('/article/fetch/user.json')
.then(function(response) {
alert(response.headers.get('Content-Type')); // application/json; charset=utf-8
alert(response.status); // 200
return response.json();
})
.then(function(user) {
alert(user.name); // iliakan
})
.catch( alert );
foreach ($results as $elements) {
$res[] = [
'tag' => 'marker',
'attributes' => [
'id' => $elements['id'],
'name' => $elements['title'],
'address' => 'Конюшенная',
'lat' => $elements['lat'],
'lng' => $elements['lng'],
'type' => $elements['category']
],
];
}