JQuery AJAX and XML Issues "No element found"

JQuery AJAX and XML Issues "No element found"

I am working with JQuery to make some basic AJAX calls to a website that provides XML data and am running into problems retrieving the XML data.

  1. <script type="text/javascript" src="jquery.js"></script>
    <script language="javascript">
          <!--
                $(document).ready(function(){
                      $.get('http://localserver/lookup.asp?id=12345', function(d){

                      });
                });
          -->
    </script>










When I run this from http://localserver/getdata.html it works. When I copy it and the jQuery libraries (jquery.js) to my desktop and run it, Firebug shows me:

GET http://localserver/lookup.asp?id=12345 200 OK (X) 70ms

The Response tab is blank and the XML view shows the following error:

XML Parsing Error: no element found Location: moz-nullprincipal:{462f5076-d371-46d3-a2d3-b639ad771f69} Line Number 1, Column 1:

The output of lookup.asp is should be identical for each request.

Replacing the URL with: http://www.merriam-webster.com/word/index.xml (Miriam Webster's Word of the Day XML) gives me the same error when run from BOTH my desktop AND the web server.




I have searched and others have solved this by changing from XML to JSON, but in this case, my data sources are only available as XML.

Just a side-note, http://localserver/lookup.asp?id=12345 returns:
  1. <?xml version='1.0' encoding='ISO-8859-1'?>
    <lookup>
    <id>12345</id>
    <name>Test</name>
    </lookup>













    • Topic Participants

    • admin