在这个代码片段中`
1) function gvizSelect(tableid) {
2) var uri = "SELECT geometry FROM " + tableid + " WHERE name = 10095";
3) var queryText = "http://www.google.com/fusiontables/gvizdata?tq=" + encodeURIComponent(uri);
4) var query = new google.visualization.Query(queryText);
5) query.send(getData);
6) }
`
我已经确认 queryText url 在直接浏览时会产生正确的响应集;但是第 4 行正在生成以下错误;“未捕获的类型错误:无法读取未定义的属性‘查询’。”
这是一个完整的 html 文件,演示了我收到的错误
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Indianatrails.com</title>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type=text/javascript>
google.load('visualization', '1',
{
'packages':['corechart', 'table', 'geomap']
}
);
var tableid = '1ZxSfeVZWVm_PuTe8Q5THFwmyR0NcGQzbSdCvQds';
var uri = "SELECT geometry FROM " + tableid + " WHERE name = 10095";
var queryText = "http://www.google.com/fusiontables/gvizdata?tq=" + encodeURIComponent(uri);
var query = new google.visualization.Query(queryText);
query.send(getData);
</script>
<body>
<h1>Test</h1>
</body>
</html>
我不知所措(经过几天阅读文档和示例)来弄清楚为什么这不起作用。任何帮助,将不胜感激!