Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 918515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:23:20+00:00 2026-05-15T18:23:20+00:00

I am trying to use the jQuery CSV plugin, as documented here: http://code.google.com/p/js-tables/wiki/CSV According

  • 0

I am trying to use the jQuery “CSV” plugin, as documented here: http://code.google.com/p/js-tables/wiki/CSV

According to the documentation:

// Convert CSV data into array of arrays
jQuery.csv()("1,2,3\n4,5,6\n7,8,9\n"); // = [ [1,2,3], [4,5,6], [7,8,9] ]

But when I attempt to do something similar, it just seems to treat the “\n” as another character in the middle of an array element.

What am I doing wrong?
I am using jQuery 1.4.2 and Firefox 3.5.10 for testing. I have also tried it with jQuery 1.3 and get the same result.

If it is a problem with the plugin, then can someone suggest another plugin for reading CSV?
My ultimate goal is to convert CSV from a string into an HTML table; the only plugin I can find that specifically does this requires the CSV to come from a file, which is not desirable for my task.

Here is a minimal test page I put together which illustrates that it’s not separating the lines into sub-arrays:

<html>
<head>
  <title>CSVtest</title>
  <script type="text/javascript" src="jquery-1.4.2.min.js"></script>
  <script type="text/javascript" src="jquery.csv.js"></script>
  <script type="text/javascript">
     $(document).ready(function() {
      var lines = $.csv()("a,b\nc,d");
      alert(lines[0][1]); // Displays: b 
                          //           c instead of the expected b
     });
  </script>
</head>
<body>
</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T18:23:22+00:00Added an answer on May 15, 2026 at 6:23 pm

    Make sure you’re using the latest version of the plugin. I copied and pasted your example using jQuery 1.4.2 and the (now outdated) CSV plugin from http://js-tables.googlecode.com/svn/trunk/jquery.csv.min.js and it works fine.

    http://jsfiddle.net/KRzzF/

    Tested in IE8, IE6, Google Chrome and Firefox. I also tested

    alert(lines[1][1]);
    

    and sure enough, the alert displayed “d”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use jquery tabs, i got the code from the site: http://docs.jquery.com/UI/Tabs
I am need paint my image. I'm trying use JQuery in here this link:
I'm trying to use jQuery.scrollTo plugin with accordion (where one block expands after clicking
I am trying to use jquery autocomplete plugin, I want it to suggest ItemCodes
Trying to use JQuery Easing plugin in my wordpress but its giving me following
im trying to use jquery tools tooltip ( http://flowplayer.org/tools/tooltip.html#events)on a form to show hints
I'm trying to use jQuery with the Validate plugin, except I cannot get my
I am trying to use jquery autocomplete plugin in my application. It works well
I'm trying to use jQuery to format code blocks, specifically to add a <pre>
I am trying to use JQuery Datatable plugin in ASP.NET MVC application. However, although

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.