I’m loading a CSV file using XHR. Of course the name suggests it must be used to load XML, but you know, there isn’t anything else really to load other kinds of files. What happens is it is trying to validate the result it receives, while it’s not required. Perhaps it believes it must be XML, or it might have some internal (wrong / arbitrary) knowledge of what CSV should look like – regardless, it raises an error of the following format:
Error: not well-formed
Source File: file:///~~~/docs/quiz.csv
Line: 1, Column: 1
Source Code:
צמתים,ארץ הגידול,שטח הגידול,אופן הגידול,קטיף/ בציר /
איסוף,שאריות,תהליכי עיבוד ושימור,אריזה,הפצת מזון,שווק/פרסום
There isn’t actually a CSV standard or anything like that, but even so, I believe that Firefox is trying to validate it as if it was XML (regardless the server sends different mime-type etc.) This doesn’t affect the functionality, the loading accomplishes successfully, but the error printed to console still bugs me. So, is there any way to cancel that validation?
You can use
to force the browser to treat the data in your way.
MDN Document