+ Reply to Thread
Results 1 to 2 of 2

Thread: Display XML data in page using Jquery

  1. #1

    Display XML data in page using Jquery

    I am trying to load the XML using that code :
    Code:
            $.ajax({
                url: '../rest/',
                dataType: "xml",
                success: showXML
    
            });
    
            function showXML(xml) {
                $("#output").text((xml));   
            }
    But it does not show my XML data in the div
    The output is : [object Document]

  2. #2
    Junior Member
    Join Date
    Apr 2012
    Posts
    17
    Because you set the dataType to xml jquery will automatically give you an object for the data-parameter of your success callback.
    Try using this signature:
    Code:
    function showXML(xml, textStatus, jqXHR)
    and:
    Code:
    $("#output").text(jqXHR.responseText);

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts