Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2012
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    misoproject/dataset site examples - cant get the code to work

    Hi,
    I'm hoping someone can point me in the right direction. New to Javascript and I I am trying to follow the examples on the misoproject/dataset site to use their script. But i cant get the code to do anything.

    What am I missing? I guess it's something simple/obvious.
    I've been trying all the examples on the miso site and I can't get any of them to work.

    Below, I'm trying a simple example and I just get a blank browser screen.

    My index.html file contains:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <html>
    <head>
    <script src="/js/miso.ds.deps.min.0.4.1.js"></script>
    &lt/head>
    <body>
    <script>
    var ds = new Miso.Dataset({
    url : 'data.csv',
    delimiter : ",",
    }).fetch({
    success: function() {
    console.log("Available Columns:" + this.columnNames());
    console.log("There are " + this.length + " rows");
    console.log(this);
    }
    });
    </script>
    </body>
    </html>
    I have data.csv saved in the same location as the index.html file. The csv contains:

    ,1995,2000,2005,2010
    Germany,29,25,28,29
    France,29,28,28,30
    Greece,35,33,33,33

    I have a folder called js and in that I have the miso.ds.deps.min.0.4.1.js file saved.

    What am I missing?
    Last edited by vinyl-junkie; 12-31-2012 at 02:24 PM. Reason: Corrected code tag

  • #2
    Regular Coder
    Join Date
    Aug 2010
    Posts
    945
    Thanks
    19
    Thanked 205 Times in 203 Posts
    I tried this and
    it "worked" for me ?
    (files must be on a server,
    this doesn't work from
    your file system)

    <!DOCTYPEHTMLPUBLIC"-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    >
    <htmlxmlns="http://www.w3.org/1999/xhtml">
    <
    html>
    <
    head>
    <
    scriptsrc="http://cloud.github.com/downloads/misoproject/dataset/miso.ds.deps.ie.0.4.1.js"></script>
    </
    head>
    <
    body>
    <
    script>
    var
    ds = new Miso.Dataset({
    url : 'data.csv',
    delimiter : ",",
    }).fetch({
    success: function() {
    console.log("Available Columns:" + this.columnNames());
    console.log("There are " + this.length + " rows");
    console.log(this);
    }
    });
    </script>
    </
    body>
    </
    html>
    Last edited by DaveyErwin; 12-31-2012 at 07:06 PM.

  • Users who have thanked DaveyErwin for this post:

    runbunnyrun (01-03-2013)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •