I'm getting api json data for weather widget. It's return null. I am getting json data very well. But i can't handle this value.
Here my html;
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script type="text/javascript" src="./js/jquery-3.3.1.min.js"></script>
</head>
<body>
<script>
/* $(document).ready(function(){
$.getJSON(url, function(json){
console.log(json.location.name);
})
})/*/
</script>
<div id="app" >{{Country}}</div>
<p v-if="isLoading">Loading</p>
<script type="text/javascript" src="./js/app.js"></script>
</body>
</html>
here my js;
window.addEventListener('load',()=>{
var app = new Vue ({
el: '#app',
data:{
Country : null,
Temp : null,
Icon : null,
isLoading : true,
},
created(){
var url ="http://api.apixu.com/v1/current.json?key=a69259fba9904700964121622190801&q=Nazilli";
$.getJSON(url,function(json){
console.log(json);
this.isLoading = false;
this.Country = json.location.name;
console.log(this.Country);
});
},
})
});
Loading
` into the `div#app`. – chrisg86 Jan 09 '19 at 19:30