Note that there are some explanatory texts on larger screens.

plurals
  1. POParsing xml data from a remote website
    primarykey
    data
    text
    <p>I would like to parse the xml data from a remote website <a href="http://services.faa.gov/airport/status/IAD?format=xml" rel="nofollow">http://services.faa.gov/airport/status/IAD?format=xml</a>...But I was not able to parse the xml data and I am only getting error. But I was able to parse the JSON data from the same remote website <a href="http://services.faa.gov/airport/status/IAD?format=json" rel="nofollow">http://services.faa.gov/airport/status/IAD?format=json</a>. The code I have used to parse the xml data is:</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;title&gt;Aviation&lt;/title&gt; &lt;script type="text/javascript" src="Scripts/jquery-1.7.2.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; var result; function xmlparser() { $.ajax({ type: "GET", url: "http://services.faa.gov/airport/status/IAD?format=xml", dataType: "xml", success: function (xml) { result = xml.city; document.myform.result1.value = result; }, error: function (xml) { alert(xml.status + ' ' + xml.statusText); } }); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;p id="details"&gt;&lt;/p&gt; &lt;form name="myform"&gt; &lt;input type="button" name="clickme" value="Click here to show the city name" onclick=xmlparser() /&gt; &lt;input type="text" name="result1" readonly="true"/&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I was only getting the error as 'o Error' in the alert box since I have printed the error message. Anybody please helpout to parse the xml data from the remote website. <strong>Note</strong>: I have also 'City' instead of 'city' but its not working... Thanks in advance...</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload