admin管理员组文章数量:1423931
I am getting this error message when trying to create a table using the Google Visualization API, with PHP & MySQL in the background.
- db connection is OK
- creating JSON from PHP array is OK
- JSON format is OK
This is the error I get: uncaught referenceerror: table is not defined
<!--Load the AJAX API-->
<script type="text/javascript" src=""></script>
<script type="text/javascript">
// Load the Visualization API and the table package.
google.load('visualization', '1.0', {'packages':['table']});
google.setOnLoadCallback(drawTable);
function drawTable() {
var tdata = new google.visualization.DataTable(
<?php echo json_encode($data); ?>);
var options = {
title: 'A Station'
};
var table_draw = new google.visualization.Table(document.getElementById('table_div'));
table_draw.draw(tdata, options);
}
I am getting this error message when trying to create a table using the Google Visualization API, with PHP & MySQL in the background.
- db connection is OK
- creating JSON from PHP array is OK
- JSON format is OK
This is the error I get: uncaught referenceerror: table is not defined
<!--Load the AJAX API-->
<script type="text/javascript" src="https://www.google./jsapi"></script>
<script type="text/javascript">
// Load the Visualization API and the table package.
google.load('visualization', '1.0', {'packages':['table']});
google.setOnLoadCallback(drawTable);
function drawTable() {
var tdata = new google.visualization.DataTable(
<?php echo json_encode($data); ?>);
var options = {
title: 'A Station'
};
var table_draw = new google.visualization.Table(document.getElementById('table_div'));
table_draw.draw(tdata, options);
}
Share
Improve this question
edited Oct 24, 2014 at 20:38
nazanin
asked Oct 24, 2014 at 19:42
nazaninnazanin
733 silver badges14 bronze badges
1
- what this has anything to do with php and mysql? – itachi Commented Oct 24, 2014 at 20:07
1 Answer
Reset to default 4You are trying to use a variable, table
, which you have never defined.
Possibly you wanted to use the variable table_draw
which you have defined in the line before.
var table_draw = new google.visualization.Table(document.getElementById('table_div'));
table_draw.draw(tdata, options);
本文标签: javascriptuncaught referenceerror table is not definedStack Overflow
版权声明:本文标题:javascript - uncaught referenceerror: table is not defined - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744658449a2618097.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论