【发布时间】:2009-07-20 08:55:30
【问题描述】:
我有一个 AJAX 查询,它发出请求并返回一些 XML。 XML 包含表格和图表的数据。该表工作正常,但图表(用于 FusionCharts)被证明是有问题的。 我使用
在 FireFox 中工作 // For some reason the .text() is not working on this, one solution is to write it to the page'
// and then read it back again.'
//'
var onlyChart = $(jData).find("chart");'
// Append the xml to the div to hold it'
//'
//$( document.getElementById("xmldiv")).append (onlyChart);'
var xmlDiv = document.getElementById("xmldiv");'
xmlDiv.innerHTML = "";'
$(xmldiv).append(onlyChart);'
alert(xmlDiv.innerHTML);'
//alert (xmlDiv.innerHTML);'
// Read the data from the div'
//'
var chartFromDiv = document.getElementById('xmldiv').innerHTML;'
这并不理想,但确实有效。不幸的是,它在 IE 中不起作用。我需要一个 jQuery 函数,它将图表标签中的 xml 放入一个变量中。我已经尝试过 text 并得到了很多 \n 回来。
对此的任何帮助都会很棒。
谢谢
约翰
【问题讨论】:
标签: jquery xml internet-explorer firefox