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 = "" + textarray[1] + "
" + "" + textarray[2] + "
" + "" + textarray[3] + "
" + "" + textarray[4] + "
" + "" + textarray[5] + "
"; } } } if(window.addEventListener) { window.addEventListener('load', ranking, false); } else { window.attachEvent("onload", ranking); }