Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 673723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:37:39+00:00 2026-05-14T00:37:39+00:00

I am trying append some XML retrieved via a dojo.XHRGet to a dijit.layout.ContentPane .

  • 0

I am trying append some XML retrieved via a dojo.XHRGet to a dijit.layout.ContentPane. Everything works ok in Firefox (3.6) but in Chrome, I only get back ‘undefined’ in the particular ContentPane.

My code looks something like this:

var cp = dijit.byId("mapDetailsPane");
cp.destroyDescendants(); // there are some existing Widgets/content I want to clear
                         // and replace with the new content

var xhrData = {
  url : "getsomexml.php",
  handleAs: "xml",
  preventCache: true,
  failOk: true
};

var deferred = new dojo.xhrGet(xhrData);
deferred.addCallback(function(data) {
  console.log(data.firstChild); // get a DOM object in both Firebug 
                                // and Chrome Dev Tools
  cp.attr("content",data.firstChild); // get the XML appended to the doc in Firefox,
                                      // but "undefined" in Chrome
});

Because in both browsers I get back a valid Document object I know XHRGet is working fine, but there seems to be some sort of difference in how the content is being set. Is there a better way to handle the return data from the request?

There was a request to see my XML, so here is part of it…

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns:svg="http://www.w3.org/2000/svg" 
 xmlns="http://www.w3.org/2000/svg" 
 xmlns:xlink="http://www.w3.org/1999/xlink" 
 version="1.1" width="672" height="1674">
 <defs>
   <style type="text/css">
     <![CDATA[ ...bunch of CSS...
     ]]>
   </style>
   <marker refX="0" refY="0" orient="auto" id="A00End" style="overflow: visible;">
   ...bunch more defs...
 </defs>
 <g id="endpoints">
   ...bunch of SVG with a some...
   <a xlink:href="javascript:gotoLogLine(16423,55);" xlink:type="simple">...more svg...</a>
 </g>
</svg>

I have run the output XML trough the WC3 validator for XML to verify it is valid. Like I said before, works in FireFox 3.6. I tried it on Safari and I got the same “undefined” so it seems to be related to Webkit.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T00:37:39+00:00Added an answer on May 14, 2026 at 12:37 am

    Does cp.containerNode.appendChild( data.firstChild ) work? Treating ContentPane as a generic container that can accept arbitrary XML nodes may be asking too much of it. It’s primary use case is -and always has been – injecting HTML. Not saying it can’t work, but its a corner case that isn’t well explored in this widget.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to append some data to a file, but in some cases want
I'm trying to make some simple XML with Java and org.w3c.dom, but I got
I'm trying to append some text to a variable in a Makefile for HP-UX's
I am trying to dynamically append some objects to a div and then programatically
I'm trying to append items to a QList at runtime, but I'm running on
I'm trying to parse some XML data using jQuery, and as it stands I
I'm trying to parse UTF-8 XML file and save some parts of it to
I have problem with Razor syntax and jQuery, I'm trying to append some items
I am trying to display some xml data from remote URL using jquery and
I'm trying to read a file then append some text to a certain place

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.