// 平坦日記RSSを取得するjs

// XMLHTTPアクセサオブジェクト取得メソッド
function getAccessor() {
  try {
    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
    try {
      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (e) {
      xmlhttp = false;
    }
  }
  if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
    xmlhttp = new XMLHttpRequest();
  }
  
  return xmlhttp;
}


//メイン関数
function rssReader(url, writeFieldId) {

	xmlhttp = getAccessor();

	if (xmlhttp) {
	    xmlhttp.onreadystatechange = function() {
    		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
        		var disp = document.getElementById(writeFieldId);
        		disp.innerHTML = xmlhttp.responseText;
			}
    	}
    	xmlhttp.open('GET', url);
		xmlhttp.send('');
  	}

}
