httpRequest = false; if(window.XMLHttpRequest) { // Firefox, Opera �Ȃ� httpRequest = new XMLHttpRequest(); //httpRequest.overrideMimeType('text/xml'); } else if(window.ActiveXObject) { // IE try { httpRequest = new ActiveXObject('Msxml2.XMLHTTP'); } catch (e) { httpRequest = new ActiveXObject('Microsoft.XMLHTTP'); } } function ranking(){ httpRequest.open("GET","http://www.town.kitagata.gifu.jp/cgi-bin/pcount/table.cgi",true); httpRequest.send(null); httpRequest.onload = function(){ var ranking = document.getElementById("access_ranking"); var text = httpRequest.responseText; var textarray = new Array(); if (text.indexOf("\n") > -1){ textarray = text.split("\n", 6); ranking.innerHTML = "<span class=\"access_ranking_list\"><img class=\"access_ranking_img\" src=\"./css/img/073.png\" />" + textarray[1] + "</span><br />" + "<span class=\"access_ranking_list\"><img class=\"access_ranking_img\" src=\"./css/img/072.png\" />" + textarray[2] + "</span><br />" + "<span class=\"access_ranking_list\"><img class=\"access_ranking_img\" src=\"./css/img/071.png\" />" + textarray[3] + "</span><br />" + "<span class=\"access_ranking_list\"><img class=\"access_ranking_img\" src=\"./css/img/070.png\" />" + textarray[4] + "</span><br />" + "<span class=\"access_ranking_list\"><img class=\"access_ranking_img\" src=\"./css/img/069.png\" />" + textarray[5] + "</span><br />"; } } } if(window.addEventListener) { window.addEventListener('load', ranking, false); } else { window.attachEvent("onload", ranking); }