zhouxinhu1 / jquerycsvtotable

Automatically exported from code.google.com/p/jquerycsvtotable
0 stars 0 forks source link

Firefox 10 reports syntax error on csv #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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");
+                       });

Original issue reported on code.google.com by harald.s...@gmail.com on 16 Feb 2012 at 9:49

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

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

Original comment by lorenzod...@gmail.com on 31 Jan 2013 at 9:17