I am trying to integrate open weather api in my application and I have invoked weather api and it's returned xml response. But when I am trying to get the values it's throwing error like unknown error.
My code is:
js code:
<script type="application/javascript">
jQuery(document).ready(function(){
$.ajax({
type: "GET",
url: "http://api.openweathermap.org/data/2.5/forecast/daily?q=Hyderabad,IN&mode=xml&appid=c9d49310f8023ee2617a7634de23c2aa",
dataType: "xml",
success: function(data) {
/* handle data here */
console.log(data);
//$('<p>Text</p>').appendTo('#weather_report');
/*var wrapper = $("#weather_report");
wrapper.empty();
wrapper.append("<div class='city'> <p>Place: " + data.city.name + "</p><p>Country: " + data.city.country + "</p></div>");
wrapper.append("<div class='day_1'> <p>Place: " + data.city.name + "</p><p>Country: " + data.city.country + "</p></div>");*/
},
error: function(xhr, status) {
/* handle error here */
}
});
});
</script>
above code returning below format:
Could you please suggest me how to get the xml values to display?
