Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 带额外参数的融合表ajax查询_Jquery_Google Fusion Tables - Fatal编程技术网

Jquery 带额外参数的融合表ajax查询

Jquery 带额外参数的融合表ajax查询,jquery,google-fusion-tables,Jquery,Google Fusion Tables,我正在通过jquery ajax查询google fusion表: var queryUrlStart = 'http://www.google.com/fusiontables/api/query?sql='; var queryUrlEnd = '&jsonCallback=?'; // ? could be a function name var sql = "SELECT * FROM " + this.tableId; if (where !== undefined) {

我正在通过jquery ajax查询google fusion表:

var queryUrlStart = 'http://www.google.com/fusiontables/api/query?sql=';
var queryUrlEnd = '&jsonCallback=?'; // ? could be a function name
var sql = "SELECT * FROM " + this.tableId;
if (where !== undefined) {
    sql += " WHERE " + where;
}
sql += " ORDER BY '" + _scaleRow.name + "' DESC";

var queryUrl = encodeURI(queryUrlStart + sql + queryUrlEnd);

$.ajax({
    type: 'POST',
    context: this,
    url: queryUrl,
    dataType: 'json',
    success: this.handleData
});
我希望能够知道正在查询哪个表,所以我希望添加一个额外的参数来标识它。我试过:

$.ajax({
    type: 'POST',
    context: this,
    data: {'table' : this.tableId}
    url: queryUrl,
    dataType: 'json',
    success: this.handleData
});

但是我在任何可以检索
表的地方都看不到它,可能有不同的方法,例如:

$.ajax({
    context: this,
    url: queryUrl,
    dataType: 'json',
    beforeSend:(function(data){return function(jqXhr){jqXhr.data=data}})
               ({'table' : this.tableId}),
    success: this.handleData
});
它使用beforeSend方法向jqXhr对象添加新属性。jqXhr对象可以在成功回调中访问(这是第三个参数),因此这将是成功回调的一个示例:

handleData=function(data,status,jqXhr){
             alert('results for table:'+jqXhr.data.table);
           };

数据:。。。将只向服务器发送数据。不会影响返回的内容。你有没有在你的掌上数据中尝试过这个.tableId?一种解决方案是在融合表“table_id”中添加一列,该列将通过SELECT返回*