설명 없음
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ranking.js 1.5KB

123456789101112131415161718192021222324252627282930313233
  1. httpRequest = false;
  2. if(window.XMLHttpRequest) {
  3. // Firefox, Opera ‚È‚Ç
  4. httpRequest = new XMLHttpRequest();
  5. //httpRequest.overrideMimeType('text/xml');
  6. } else if(window.ActiveXObject) {
  7. // IE
  8. try {
  9. httpRequest = new ActiveXObject('Msxml2.XMLHTTP');
  10. } catch (e) {
  11. httpRequest = new ActiveXObject('Microsoft.XMLHTTP');
  12. }
  13. }
  14. function ranking(){
  15. httpRequest.open("GET","http://www.town.kitagata.gifu.jp/cgi-bin/pcount/table.cgi",true);
  16. httpRequest.send(null);
  17. httpRequest.onload = function(){
  18. var ranking = document.getElementById("access_ranking");
  19. var text = httpRequest.responseText;
  20. var textarray = new Array();
  21. if (text.indexOf("\n") > -1){
  22. textarray = text.split("\n", 6);
  23. 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 />";
  24. }
  25. }
  26. }
  27. if(window.addEventListener) {
  28. window.addEventListener('load', ranking, false);
  29. } else {
  30. window.attachEvent("onload", ranking);
  31. }