Loading ...
Sorry, an error occurred while loading the content.

Re: [ydn-javascript] yui o.responseXML has no properties

Expand Messages
  • Liam Rice
    never mind, I m a twit, forgot to set the contentType on the asp :). ... -- Liam David Edwin Rice liam.rice@gmail.com
    Message 1 of 2 , Jul 4, 2007
    • 0 Attachment
      never mind, I'm a twit, forgot to set the contentType on the asp :). 

      On 7/4/07, squib147 <liam.rice@... > wrote:

      Hey all, I'm just playing around with the responseXML, but I'm having
      some issues in figuring out what I am doing wrong. I've got a js
      function that connects to an asp page to get some xml

      function setVehDesc() {
      var veh = document.getElementById('veh').value;

      var handleSuccess = function(o) {
      var root = o.responseXML.documentElement;
      var oDesc = root.getElementsByTagName('desc')
      [0].firstChild.nodeValue;
      var oImgsrc = root.getElementsByTagName('imgsrc')
      [0].firstChild.nodeValue;

      console.info(oDesc + '::' + oImgsrc);
      }

      var handleFailure = function(o) {
      alert('There was an error.');
      }

      var callback = {
      success:handleSuccess,
      failure:handleFailure
      };

      YAHOO.util.Connect.asyncRequest
      ('GET','includes/getVehicleDescription.asp?veh=' + veh,callback);
      }

      It connects to an asp page that returns xml...

      <%
      function getVehicleDesc()
      getVehicleDesc = "some desc"
      end function
      %>
      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
      <asc>
      <desc><%=getVehicleDesc()%></desc>
      <imgsrc>the img src</imgsrc>
      </asc>

      But, I keep getting this error from Firebug...
      o.responseXML has no properties

      Anybody have any ideas what I may be doing wrong? I'm connecting to
      the page no problem, as I had it as a o.responseText before trying
      this.
      --
      Liam David Edwin Rice




      --
      Liam David Edwin Rice
      liam.rice@...
    Your message has been successfully submitted and would be delivered to recipients shortly.