アットウィキロゴ

v2v4ppp

var x = new Array();
var y = new Array();
var fx = new Array();
var fy = new Array();
 
function sample() {
 
        var query = "SELECT * FROM " +
            '186_2YKglPqgbU5-8b-N7HAJ2AQDvacwy6QLW02_4';
        var encodedQuery = encodeURIComponent(query);
 
        var url = ['https://www.googleapis.com/fusiontables/v1/query'];
        url.push('?sql=' + encodedQuery);
        url.push('&key=AIzaSyAH0WCAXRIdHdbI-6bnMSN4kVDDZZmGyqY');
        url.push('&callback=?');
 
 
 
 
 
        $.ajax({
            url: url.join(''),
            dataType: 'jsonp',
            success: function (data) {
                var rows = data['rows'];
 
 
 
                sx = 0;
 
                for (var i in rows) {
                    sx = sx + 1;
                    x[sx] = rows[i][0] / 1;
                    y[sx] = rows[i][1] / 1;
                }
 
                number = sx;
 
 
                paint();
 
 
 
 
 
            }
        });
 
}
 
function paint(){
 
 
   str1="<table class=\"mdl-data-table mdl-js-data-table mdl-data-table--selectable mdl-shadow--2dp\">";
  str2="<th class=\"mdl-data-table__cell--non-numeric\">";
  str3="<td class=\"mdl-data-table__cell--non-numeric\">";
 
   str=str1;
   str=str+"<thead>";
   str=str+"<tr>";
 
     str=str+"<th>x</th>";
      str=str+"<th>y</th>";
 
    str=str+"</tr>"
  str=str+"</thead>";
 
  str=str+"<tbody>";
   for(s=1;s<number+1;s++){
   str=str+"<tr>";
   str=str+"<td>"+x[s]+"</td>";
   str=str+"<td>"+y[s]+"</td>";
 
   str=str+"</tr>";
   }
str=str+"</table>";
 
 
 
 $("#tab2").html(str);
 
 
 
 
}
最終更新:2016年03月13日 00:55