
// workaround for firefox which splits nodeValue in packets of 4096 bytes
// see https://bugzilla.mozilla.org/show_bug.cgi?id=194231
getXmlNodeValueWithout4KBLimit: function(xmlTag) {
if(xmlTag.firstChild.textContent && xmlTag.normalize) {
xmlTag.normalize(xmlTag.firstChild);
content=xmlTag.firstChild.textContent;
} else if(xmlTag.firstChild.nodeValue) {
content=xmlTag.firstChild.nodeValue;
} else {
content=null;
}
return content;
}
By the way ist es ein ziemliches Gefrickel mit Javascript XML zu parsen. Nicht nur dass es wieder jeder Browser (insbes. IE) anders haben moechte, nein, es ist auch noch recht langsam. Hier bietet sich im Zweifelsfalle an JSON zu benutzen. Z.B. so:
var jsonContainer =
[
{
"name" : "name1",
"icon" : "img/muetze.gif"
},
{
"name" : "name2",
"icon" : "img/glatze.gif"
}
];
Der Zugriff erfolgt dann bspw. mit jsonContainer[1].icon.
Weiss jemand ob es eine utf8-decode Funktion in Javascript NATIV gibt? Ich fand nur Selbstgefrickeltes in Form eines zeichenweisen Absuchens und Ersetzes -> vieeel zu langsam..