function createHttpRequest() { if(window.ActiveXObject) { //for Windows IE  try {   return new ActiveXObject("Msxml2.XMLHTTP") //MSXML2 and above   } catch (e) {  try {   return new ActiveXObject("Microsoft.XMLHTTP") //old MSXML   } catch (e2) {   return null   }  } } else if(window.XMLHttpRequest){  //Win ie以外のXMLHttpRequestオブジェクト実装ブラウザ用  return new XMLHttpRequest(); } else {  return null }}function sendRequest (uri, rest) {//method, data, async, modId var method = rest.method? rest.method : 'GET'; var async  = rest.async?  rest.async  : true; var data   = rest.data; var modId  = rest.modId; /* if (typeof(async) != 'string') {  async = true; } if (typeof(method) != 'string') {  method = 'GET'; }*/ var httpObj = createHttpRequest(); httpObj.open(method, uri, async); httpObj.onreadystatechange = function() {   if (httpObj.readyState == 4) {    on_loaded(httpObj, modId);  } }     httpObj.send(data);}function on_loaded(obj, modId) { $(modId).innerHTML = obj.responseText;}  /*USAGE:var data = sendRequest('/cgi/test.cgi', {modId:'testid'}); sendRequest('/cgi/test.cgi', { modId:'testid', method:'GET', async:true, data:null }); and element testid will be replaced by '/cgi/test.cgi';*/