Export to GitHub

jquerycsvtotable - issue #2

Firefox 10 reports syntax error on csv


Posted on Feb 16, 2012 by Grumpy Lion

Load a csv from a local file (not http content-type set)

Works with Chrome (with --allow-file-access-from-files) Firefox reports "sytax error" on the .csv file

Fix: add "text" as the last argument to $.get() to prevent Firefox from parsing the file,line 150

--- jquery.csvToTable.js 2012-02-16 10:48:18.000000000 +0100 +++ jquery.csvToTable.js.orig 2012-02-16 10:48:11.000000000 +0100 @@ -150 +150 @@ - }, "text"); + });

Comment #1

Posted on Jan 31, 2013 by Happy Monkey

Use "$.ajaxSetup({ mimeType: "text/plain" });" to fix syntax errors in firefox (not working in google chrome)

Example:

$(function() { $.ajaxSetup({ mimeType: "text/plain" }); $('#CSVTable').CSVToTable('test.csv', { loadingImage: 'images/loading.gif', startLine: 0, separator: "\t" }); });;

Status: New

Labels:
Type-Defect Priority-Medium