Answer the question
In order to leave comments, you need to log in
Why does the Api request to New Mail not work?
You need to make two inputs. In one, it will be necessary to enter the name of the city and have hints, with the presence of a city with such a part of the text. In the second, the street or branch number was entered, and there was a hint with the possibility of choosing this branch.
I've made such a template to play around with the new mail api, and at the beginning, connect.
https://jsfiddle.net/lilandre/ao5L42g1/2/
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Working with Pochta Api</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="script.js"></script>
</head>
<body>
<div id="text_test">
</div>
</body>
</html>
$(function(){
var $texts=$('#text_test');
$.ajax({
type: "GET",
url: "https://api.novaposhta.ua/json",
"modelName": "Address",
"calledMethod": "searchSettlements",
"methodProperties": {
"CityName": "ки",
"Limit": 555
},
"apiKey": "f11a8e14401ddcf710f7195b4ebe358c",
success: function(texts){
$.each(texts, function(i, text){
$.orders.append('<li> Город или село:'+text.SettlementTypeCode+',Название:'+text.MainDescription+'</li>');
});
}
});
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question