function init_load() {
  $('#loading').html("Loading...");

  server = location.pathname.split('/')[1];
  $.ajax({
    url: "/api/v1/tags?server="+server+"&limit=15&sort=true",
    dataType: "json",
    timeout: 30000,
    success: function(j){
      render(j);
    }
  });
}

function render(j) {
  document.charset='UTF-8';
  document.characterSet = 'UTF-8';

  data = "";
    $.each(j, function(key, value){
      data += "<tr><td>" + value.text + "</td>"
      data += "<td>" + value.weight + "回</td>"
      data += "</tr>"
    });
    data += "<br>"
    $('#data').html(data);
    $('#loading').html("done.");
}

init_load();
