javascript - ReferenceError: Papa is not defined - Stack Overflow

so I'm trying to setup PapaParser to parse a CSV file onto arrays that I can later use with anothe

so I'm trying to setup PapaParser to parse a CSV file onto arrays that I can later use with another script to make graphs. So far I just want to paste the strings from my arrays onto the blank div, so I can see what's going on. I am new to this and have no idea how to import javascript libraries, so I copied the files into my public_html folder. Now NetBeans seems to see them.

Long story short I'm stuck at the beginning, I get a reference of ReferenceError: Papa is not defined when I try to run my parser.

Any input or a link to a tutorial on how to do this would be greatly appreciated (tried googling, found nothing of use). I've added my code so far...

Papa.parse("TopPercentilesCSV.csv", {
		plete: function(results) {
			console.log("Finished:", results.data);
		}
	});
.displaypanel {
    border: 1px solid black;
    width:400px;
    height:400px;
    margin:auto;
}
<!DOCTYPE html>

<html>
    <head>
        <title>Parsing CSV test</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link type="text/css" rel="stylesheet" href="index.css"/>
        <script type="text/javascript" src="index.js"></script>
        <script src="PapaParse/papaparse.js"></script>
    </head>
    <body>
        <div class="displaypanel">            
        </div>
    </body>
</html>

so I'm trying to setup PapaParser to parse a CSV file onto arrays that I can later use with another script to make graphs. So far I just want to paste the strings from my arrays onto the blank div, so I can see what's going on. I am new to this and have no idea how to import javascript libraries, so I copied the files into my public_html folder. Now NetBeans seems to see them.

Long story short I'm stuck at the beginning, I get a reference of ReferenceError: Papa is not defined when I try to run my parser.

Any input or a link to a tutorial on how to do this would be greatly appreciated (tried googling, found nothing of use). I've added my code so far...

Papa.parse("TopPercentilesCSV.csv", {
		plete: function(results) {
			console.log("Finished:", results.data);
		}
	});
.displaypanel {
    border: 1px solid black;
    width:400px;
    height:400px;
    margin:auto;
}
<!DOCTYPE html>

<html>
    <head>
        <title>Parsing CSV test</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link type="text/css" rel="stylesheet" href="index.css"/>
        <script type="text/javascript" src="index.js"></script>
        <script src="PapaParse/papaparse.js"></script>
    </head>
    <body>
        <div class="displaypanel">            
        </div>
    </body>
</html>

Share Improve this question asked Dec 30, 2014 at 11:13 Miha ŠušteršičMiha Šušteršič 10.1k27 gold badges97 silver badges175 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 3

Change your code to this:

<!DOCTYPE html>

<html>
    <head>
        <title>Parsing CSV test</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link type="text/css" rel="stylesheet" href="index.css"/>
        <script src="PapaParse/papaparse.js"></script>
        <script type="text/javascript" src="index.js"></script>

    </head>
    <body>
        <div class="displaypanel">            
        </div>
    </body>
</html>

First you have to include the library, then you can call function defined inside

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745605037a4635626.html

相关推荐

  • javascript - ReferenceError: Papa is not defined - Stack Overflow

    so I'm trying to setup PapaParser to parse a CSV file onto arrays that I can later use with anothe

    3小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信