Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-31-2012, 01:01 PM   PM User | #1
runbunnyrun
New to the CF scene

 
Join Date: Dec 2012
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
runbunnyrun is an unknown quantity at this point
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
runbunnyrun is offline   Reply With Quote
Old 12-31-2012, 06:45 PM   PM User | #2
DaveyErwin
Regular Coder

 
Join Date: Aug 2010
Posts: 810
Thanks: 12
Thanked 168 Times in 166 Posts
DaveyErwin is on a distinguished road
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..
DaveyErwin is offline   Reply With Quote
Users who have thanked DaveyErwin for this post:
runbunnyrun (01-03-2013)
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:20 AM.


Advertisement
Log in to turn off these ads.