fjcapelo / jquery-csv

Automatically exported from code.google.com/p/jquery-csv
MIT License
0 stars 0 forks source link

Using Zurb Foundation 3 causing an error #40

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. We've used jquery-csv with no issues until we recently upgraded from Zurb 
Foundation 2 to Zurb Foundation 3. Now we get a jquery error.

Here's a Foundation2 page which does work:
http://www.nwcouncil.org/reports/financial-reports/2014-99/legal/

And a Foundation3 page which causes an error:
http://www.nwcouncil.org/reports/financial-reports/2014-99/admin

Chart is supposed to appear under "Staffing" heading, but developer console 
shows "Uncaught TypeError: Cannot read property 'toArrays' of undefined " at 
the line:

$.get(path+"rngHistoryByFunction.csv", function (csvString) {
            arrayData = $.csv.toArrays(csvString, { onParseValue: $.csv.hooks.castToScalar });

The Zurb Foundation seems the culprit because changing our two Zurb .js calls 
(foundation.js, app.js) from Foundation3 back to 2 fixes the problem.

Original issue reported on code.google.com by eschrepel@gmail.com on 15 Apr 2014 at 6:45

GoogleCodeExporter commented 9 years ago
Oh last note, this is all running inside of Umbraco CMS (6.1.6).

Original comment by eschrepel@gmail.com on 15 Apr 2014 at 6:51

GoogleCodeExporter commented 9 years ago
I'm not familiar with the Zurb Foundation framework or Umbraco CMS.

I assume it has to do with the loading order of scripts. For some reason, 
$.csv.toArrays is being called before the jquery.csv.js script is loaded and 
attached to the $ namespace.

The order of script definitions matter unless you're using a dependency library 
like RequireJS or AMD to load external JS scripts.

Does $.get work without issue? 
Are forcing the attached code to wait until $(document).ready() before loading 
it? That might help.

Original comment by evanpla...@gmail.com on 29 May 2014 at 3:19

GoogleCodeExporter commented 9 years ago
I'm getting this too by trying to use $.csv.toArrays from a paste event, 
calling it at the point I subscribe to the paste event works fine. I'm very new 
to javascript though so I may be doing something wrong.

Original comment by ChrisDot...@gmail.com on 10 Feb 2015 at 1:51