0

我正在使用框架 web2py,我在文件中创建文件 JSON,default.py然后在我的文件中调用它之后,.js我想在我的文件 JSON 中获取查询,但它不起作用。

我的文件.js中有一个获取查询的函数(如下所示):

function createQueryCityName(strUser) { 
    var query = new google.visualization.Query ("http://127.0.0.1:8000/ecobayes_reporting/default/call/json/get_data_physics");
    //var query = new google.visualization.Query ("http://api.batisense.com/batisense/datasource?table=montmorin");
    console.log(query);
    query.setQuery("select building_name");
    console.log(query);
    //return query;
    //query.send(drawTable);
}

在它将查询发送到另一个函数之后,如下所示:

function drawTable(query) {
   /* 
    if (query.isError()) {
    alert('Error in query: ' + query.getMessage() + ' ' + query.getDetailedMessage());
    return;
    }
   */
    console.log(query);
    var data = query.getDataTable();
    //var data = new google.visualization.DataTable();
    var table = new google.visualization.Table(document.getElementById('table_div'));
    table.draw(data);
}

但我不知道为什么它不起作用。在我的控制台中,我有这个:

GET http://127.0.0.1:8000/ecobayes_reporting/static/js/jquery-1.10.0.min.map 404 (NOT FOUND) index:198
ls {jf: "auto", tj: false, Mg: Object, sj: false, rj: "http://api.batisense.com/batisense/datasource?table=montmorin"…}
 PhysicsReports.js:38
ls {jf: "auto", tj: false, Mg: Object, sj: false, rj: "http://api.batisense.com/batisense/datasource?table=montmorin"…}
 PhysicsReports.js:40
Event {clipboardData: undefined, cancelBubble: false, returnValue: true, srcElement: document, defaultPrevented: false…}
 PhysicsReports.js:51
Uncaught TypeError: Object #<Event> has no method 'getDataTable' PhysicsReports.js:52
4

0 回答 0