1

I'm trying to load an XML file in a chrome packaged app and keep getting the error "Uncaught SyntaxError: Unexpected token < index.html:1"

The XML file is local in the app and am loading it using javascript. The error is related to the loading of the XML file as when I remove the first "<" from the file it changes the error to the next character.

The file is being loaded simply with var documentURL = "file.xml"; and is followed with a function which uses the file.

Any ideas?

Thanks.

julian
  • 63
  • 1
  • 6
  • 2
    You get the error because the browser is trying to execute the XML as JavaScript (which it isn't). See the link: http://stackoverflow.com/questions/19934187/unexpected-token-reading-xml-file – Dayton Wang Feb 13 '15 at 22:00
  • @gui47 You should flag this as a duplicate. – Xan Feb 14 '15 at 16:44

0 Answers0