dojo.XHRGet
을 통해 검색된 XML을 dijit.layout.ContentPane
에 추가하려고합니다. Firefox (3.6)에서는 모든 것이 정상적으로 작동하지만 Chrome에서는 특정 ContentPane에서만 '정의되지 않음'상태가됩니다.dojo/dijit ContentPane 설정 내용
내 코드는 다음과 같이 보입니다 : 두 브라우저에서 내가 다시 유효한 Document
개체를 얻을 수 있기 때문에
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
});
내가 XHRGet가 잘 작동 알고,하지만 내용이 얼마나 차이의 일종있을 것 같습니다 되고있다. 요청에서 반환 데이터를 처리하는 더 좋은 방법이 있습니까? XML이 유효한지 확인하기 위해 이렇게 여기의 일부입니다 내 XML을 볼 수있는 요청이 있었다
... 내가 출력 XML을 실행 한
<?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>
는 WC3 검사기 물마루. 전에 말했듯이, FireFox 3.6에서 작동합니다. 사파리에서 시도해 보았고 동일한 "정의되지 않은"결과를 얻었 기 때문에 Webkit과 관련이있는 것으로 보입니다.
xml이 어떻게 보이는지 보여 줄 수 있습니까? – Philippe
XML을 편집하도록 편집되었습니다. – Kitson