I am reading a text file trough XMLHttpRequest inside Firefox trough the normal means, the text file consist of a single line of picture filenames seperated with a pipe symbol (‘|’).
Everything works in the end, my image list gets read, i can parse it just fine and load my pictures.
Here is the code for the curious.
bilderListeDatei.open("GET","./bilder/liste?nocachetrick="+jetzt.getTime(),true);
bilderListeDatei.onreadystatechange = function ()
{
if (bilderListeDatei.readyState === 4)
{
if (bilderListeDatei.status === 200)
{
bilderListe = bilderListeDatei.responseText.split("|");
elementeZuLaden += bilderListe.length;
for(var i in bilderListe)
{
var j = bilder.push(new Image());
bilder[j-1].onload = function()
{
elementeGeladen++;
if(elementeZuLaden == elementeGeladen){elementeLadenFertig = true;}
}
bilder[j-1].src = "./bilder/" + bilderListe[i];
//alert(j);
}
}
}
}
As said the syntax error is produced inside my text file, not the code, that works flawlessly.
Any idea how i could get rid of that (ignored by the rest of the programm) error message?
EDIT:
The error message because it got mangled up in the comment:
Zeitstempel: 18.01.2013 14:15:01
Fehler: Syntax-Fehler
Quelldatei: http://192.168.2.102/seitenbastel/bilder/liste?nocachetrick=1358514901070
Zeile: 1, Spalte: 1
Quelltext:
65.jpg|67.jpg|69.jpg|71.jpg|73.jpg|75.jpg|77.jpg|79.jpg|81.jpg|83.jpg|85.jpg|87.jpg|89.jpg|91.jpg|93.jpg|95.jpg|97.jpg
XMLHttpRequest will try to parse the results as XML, in general, to create the
responseXMLobject. Your data is presumably not XML. You either need to tell the browser that in yourContent-Typeheader (e.g. setting it totext/plainin your case) or tell the browser that you don’t actually want a parsed DOM representation at all by settingresponseType = "text"on the XHR object if you only plan to use the text.