// JavaScript Document


<!-- Submit -->
function xmlhttpPost(strURL) {
    var xmlHttpReq = false;
    var self = this;

try
  {
  // Firefox, Opera 8.0+, Safari
   self.xmlHttpReq = new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
     self.xmlHttpReq = new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    try
      {
       self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Your browser does not support AJAX!");
      return false;
      }
    }
  }

    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=utf-8');
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            //updatepage(self.xmlHttpReq.responseText);
            alert('投稿しました。更新ボタンを押してください。');
        }
    }
    self.xmlHttpReq.send(getquerystring());
}

function getquerystring() {
    var form     = document.forms['f1'];
    var word = form.word.value;
    qstr = 'w=' + encodeURIComponent(word);  // escape(word) NOTE: no '?' before querystring
    return qstr;
}

function updatepage(str){
    document.getElementById("result").innerHTML = str;
}
<!-- Submit -->

<!-- Display -->
function ajaxFunction(Source, Target)
{
var xmlHttp;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Your browser does not support AJAX!");
      return false;
      }
    }
  }
  xmlHttp.onreadystatechange=function()
    {
    if(xmlHttp.readyState==4)
      {
      document.getElementById(Target).innerHTML = xmlHttp.responseText;
      }
    }
  xmlHttp.open("GET",Source+"?"+(new Date).getTime(),true);
  xmlHttp.send(null);
  }
<!-- Display -->


<!-- ++ Google AJAX Feed API [[Change]] ++ -->
function feedchange(type){

    document.getElementById("feed").innerHTML = "";
    google.load("feeds", "1");
    function initialize(type) {
      var url = "";
      var jname ="";
      if(type == 'sci'){
	url = "http://www.sciencemag.org/rss/current.xml";
        jname = "Science";
      }else if(type == 'nat'){
        url = "http://www.nature.com/nature/current_issue/rss/index.html";
	jname = "Nature";
      }else if(type == 'pcl'){
        url = "http://www.plantcell.org/rss/current.xml";
	jname = "Plant Cell";
      }else if(type == 'plt'){
        url = "http://www.springerlink.com/content/100484/?sortorder=asc&export=rss";
	jname = "Planta";
      }else if(type == 'ptj'){
        url = "http://www3.interscience.wiley.com/rss/journal/118488398";
	jname = "The Plant Journal";
      }else if(type == 'pps'){
        url = "http://www.plantphysiol.org/rss/current.xml";
	jname = "Plant Physiology";
      }else if(type == 'ppt'){
        url = "http://www3.interscience.wiley.com/rss/journal/118510326";
	jname = "Physiologia Plantarum";
      }else if(type == 'pmb'){
        url = "http://www.springerlink.com/content/100330/?sortorder=asc&export=rss";
	jname = "Plant Molecular Biology";
      }


      var feed = new google.feeds.Feed(url);
      feed.setNumEntries(10);
      feed.load(function(result) {
        if (!result.error) {
          var container = document.getElementById("feed");
          var h2 = document.createElement("h3");
          var a_head = document.createElement("a");
          a_head.setAttribute('target', '_blank');
          a_head.href = url;
	  var str_head = document.createTextNode(jname);
          a_head.appendChild(str_head);
	  h2.appendChild(a_head);
          container.appendChild(h2);
	  var br = document.createElement("br");
          container.appendChild(br);

          for (var i = 0; i < result.feed.entries.length; i++) {
            var entry = result.feed.entries[i];
            var attributes = ["title", "link", "dc:date"];
              var ele = document.createElement("a");
	      ele.setAttribute('target', '_blank');
	      ele.href = entry[attributes[1]];
              var str = document.createTextNode(entry[attributes[0]]);
              ele.appendChild(str);
	      var li = document.createElement("li");
	      li.appendChild(ele);
	      container.appendChild(li);
          }
        }
      });
    }
    initialize(type);
    //google.setOnLoadCallback(initialize);
}
<!-- ++ Google AJAX Feed API [[Change]] ++ -->

<!-- ++ Google AJAX Feed API ++ -->
function googlefeed(){
    google.load("feeds", "1");
    function initialize() {
      var feed = new google.feeds.Feed("http://www.sciencemag.org/rss/current.xml");
      feed.setNumEntries(6);
      feed.load(function(result) {
        if (!result.error) {
          var container = document.getElementById("feed");
          var h2 = document.createElement("h3");
          var url = "http://www.sciencemag.org/rss/current.xml";
          var a_head = document.createElement("a");
          a_head.setAttribute('target', '_blank');
          a_head.href = url;
	  var str_head = document.createTextNode("Science");
          a_head.appendChild(str_head);
	  h2.appendChild(a_head);
          container.appendChild(h2);
	  var br = document.createElement("br");
          container.appendChild(br);

          for (var i = 0; i < result.feed.entries.length; i++) {
            var entry = result.feed.entries[i];
            var attributes = ["title", "link"];
              var ele = document.createElement("a");
	      ele.setAttribute('target', '_blank');
	      ele.href = entry[attributes[1]];
              var str = document.createTextNode(entry[attributes[0]]);
              ele.appendChild(str);
var li = document.createElement("li");
li.appendChild(ele);
              container.appendChild(li);
          }
        }
      });
    }
    google.setOnLoadCallback(initialize);
}
<!-- ++ Google AJAX Feed API ++ -->

