I'm creating a web application for a client and I'm having difficulty getting the XML data from the https://aviationweather.gov/ ADDS TextData Server. I am trying to pull the XML data and convert it to HTML in a specific paragraph of my website. Here is the TextData Server address that I'm using for XML: Aviation Weather
$("#findMETAR").click(function(event){
var airport = $('#airportCode').val();
$.ajax({
type: "GET",
url:"http://www.aviationweather.gov/adds/dataserver_current/httpparam?dataSource=metars&requestType=retrieve&format=xml&hoursBeforeNow=3&mostRecent=TRUE&stationString="+encodeURIComponent(airport),
dataType: "xml",
success: processXML,
});
function processXML(xml) {
$("#metarData").html($(xml).find("raw_text").text());
}
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<h1>Metar Finder</h1>
<p class="lead white">Enter the airport ICAO airport code to find the most recent metar</p>
<p id="metarData"><!--METAR DISPLAYED HERE--></p>
<form>
<div class="form-group">
<input type="text" class="form-control" name="airportCode" id="airportCode" placeholder="e.g. KLAX, KDEN, KJFK..."/>
</div>
<button id="findMETAR">Find METAR</button>
</form>