$(function(){
var $texts=$('#text_test');
$.ajax({
type: "GET",
url: "https://api.novaposhta.ua/json",
"modelName": "Address",
"calledMethod": "searchSettlements",
"methodProperties": {
"CityName": "ки",
"Limit": 555
},
"apiKey": "f11a8e14401ddcf710f7195b4ebe358c",
"headers": {
"content-type": "application/json",
}
success: function(texts){
$.each(texts, function(i, text){
$.orders.append('<li> Город или село:'+text.SettlementTypeCode+',Название:'+text.MainDescription+'</li>');
});
}
});
})
<!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>');
});
}
});
})
$text: blue
$background: #333333
$fuck_font: yellow
$someWidth: 320px
.tesstSass
color: $text
background: $background
.goOut
color: $fuck_font
float: left
background: linear-gradient(to top, #fefcea, #f1da36)
.goOut
color: $fuck_font
@media(max-width: $someWidth){
color: red
}
@media (max-width: 320px){(сасс код)}
так, чтобы она работала?
Вылетает все та же : Failed to load https://api.novaposhta.ua/json: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.