$(function(){ var is_sp_sougo_list = false; if($(".sougo_list")[0]){ init_sougo_list(); render_sougo_list(); } function init_sougo_list(){ var dev = "pc"; var ua = navigator.userAgent; if((ua.indexOf('Android') > 0 && ua.indexOf('Mobile') == -1)){ dev = "pc"; }else if ((ua.indexOf('Android') > 0 && ua.indexOf('Mobile') > 0)){ dev = "sp"; }else if (ua.indexOf('iPhone') > 0){ dev = "sp"; }else if (ua.indexOf('iPad') > 0){ dev = "pc"; }else if (ua.indexOf('iPod') > 0){ dev = "sp"; }else if (ua.indexOf('Windows Phone') > 0){ dev = "sp"; }else if (ua.indexOf('WindowsPhone') > 0){ dev = "sp"; }else{ dev = "pc"; } if(dev == "sp"){ is_sp_sougo_list = true; } } function render_sougo_list() { var url = document.URL; var entity = "index_sougo_rank"; if(url.match(/text/)){ entity = "article_sougo_rank"; }else if(url.match(/popular/)){ entity = "popular_sougo_rank"; }else if(url.match(/tags/)){ entity = "tags_sougo_rank"; }else if(url.match(/index/)){ entity = "index_sougo_rank"; }else if(url.match(/fun$/)){ entity = "index_sougo_rank"; }else if(url.match(/fun\/$/)){ entity = "index_sougo_rank"; }else{ entity = "etc_sougo_rank"; } $.ajax({ type: 'GET', url: "/js/sougo_list.json", dataType: 'json', timeout:5000, //async: true, context:{ p_entity: entity, }, success: function(json){ var len = json.length; if(len < 1){ return; } var buff = ""; var today = new Date(); var td_fmt = (today.getMonth() +1) + '/' + today.getDate() + "の集計" if(is_sp_sougo_list){ buff += '