我是jquery和javascript编码的新手,并且我正在使用以下代码从csv文件读取数据,并使用jquery使用它来形成wordCloud。
<!DOCTYPE html>
<html>
<head>
<title>jQCloud Example</title>
<link rel="stylesheet" type="text/css" href="jqcloud.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript" src="jqcloud-1.0.4.js"></script>
<script type="text/javascript" src="csvjson.js" ></script>
<script type="text/javascript">
$(document).ready(function() {
$.ajax("http://localhost:8000/wordCloud.csv", {
success: function(data) {
console.log('Obtained csv file');
var jsonobject = csvjson.csv2json(data);
$(function() {
console.log('creating cloud');
$("#example").jQCloud(jsonobject);
});
},
error: function() {
console.log('Not Obtained');
}
});
});
</script>
</head>
<body>
<div id="example" style="width: 550px; height: 350px;"></div>
</body>
</html>
运行时出现空白页。 它甚至不显示任何控制台语句,根本不执行该功能。 我可能做错了什么。 或者是否有其他方法可以生成单词云,以从csv文件中获取“单词”和“频率”数据。