我自己的ajax的js檔案,我自己看的

來源:互聯網
上載者:User

 var XMLHttpReq = false;      

    function createXMLHttpRequest() {        if(window.XMLHttpRequest) { // 判斷是不是Mozilla          XMLHttpReq = new XMLHttpRequest();      }     else if (window.ActiveXObject) {try {XMLHttpReq = new ActiveXObject("Msxml2.XMLHTTP");} catch (e) {try {XMLHttpReq = new ActiveXObject("Microsoft.XMLHTTP");} catch (e) {}}}}function sendRequest() {    var url="oaSchedule.do?action=get";createXMLHttpRequest();XMLHttpReq.open("GET", url, true);XMLHttpReq.onreadystatechange = processResponse;XMLHttpReq.send(null);  setTimeout("sendRequest()",60000);}    function processResponse() {    if (XMLHttpReq.readyState == 4) {         if (XMLHttpReq.status == 200) {              show();            } else {                window.alert("議程資訊讀取逾時");            }        }    }  function show() {      var ids = XMLHttpReq.responseXML.getElementsByTagName("id");    var contents = XMLHttpReq.responseXML.getElementsByTagName("content");    var remindtimes = XMLHttpReq.responseXML.getElementsByTagName("remindtime");    var starttimes = XMLHttpReq.responseXML.getElementsByTagName("starttime");    var url1="";//    window.alert(ids[0].firstChild.nodeValue);       if(ids[0].firstChild.nodeValue==0){       }       else{    for(var i = 0; i < contents.length; i++) {//            window.alert(ids[i].firstChild.nodeValue);//              window.alert(contents[i].firstChild.nodeValue);//              window.alert(remindtimes[i].firstChild.nodeValue);//              window.alert(starttimes[i].firstChild.nodeValue);                var content = document.getElementById("content");   //                content.innerHTML="<a title='點擊查看詳情' href='oaSchedule.do?action=show'><font color='red'>"+ contents[i].firstChild.nodeValue +"</font></a></br></br>"+//                                   "      <a href='oaSchedule.do?action=update'>"+ "不再提示" +"</a>"                  url1+="<a title='點擊查看詳情' href='javascript:open_ScheduleAdd("+ ids[i].firstChild.nodeValue +",2);'><font color='red'>"+ contents[i].firstChild.nodeValue +"</font></a>"+                                   "      <a href='javascript:update("+ ids[i].firstChild.nodeValue +",0);'>"+ "不再提示" +"</a><br>"    }        content.innerHTML=url1;         getMsg();      }}function ShowList() {    clearList();    var product = document.getElementById("product");    var results = XMLHttpReq.responseXML.getElementsByTagName("name");    var option = null;    for(var i = 0; i < results.length; i++) {        option = document.createElement("option");        option.appendChild(document.createTextNode(results[i].firstChild.nodeValue));        product.appendChild(option);    }}function clearList() {    var product = document.getElementById("product");    while(product.childNodes.length > 0) {        product.removeChild(product.childNodes[0]);    }}// ri cheng  tishiwindow.onresize = resizeDiv;window.onscroll = resizeDiv;window.onerror = function(){}var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;function getMsg(){  try{  divTop = parseInt(document.getElementById("eMeng").style.top,10)  divLeft = parseInt(document.getElementById("eMeng").style.left,10)  divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10)  divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10)  docWidth = document.body.clientWidth;  docHeight = document.body.clientHeight;  document.getElementById("eMeng").style.top = parseInt(document.body.scrollTop,10) + docHeight + 10;// divHeight  document.getElementById("eMeng").style.left = parseInt(document.body.scrollLeft,10)  document.getElementById("eMeng").style.visibility="visible"  objTimer = window.setInterval("moveDiv()",10)  }  catch(e){}}function resizeDiv(){//  i+=1//  if(i>1000) closeDiv()  try{  divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10)  divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10)  docWidth = document.body.clientWidth;  docHeight = document.body.clientHeight;  document.getElementById("eMeng").style.top = docHeight - divHeight + parseInt(document.body.scrollTop,10)  document.getElementById("eMeng").style.left = parseInt(document.body.scrollLeft,10)  }  catch(e){}}function moveDiv(){  try  {  if(parseInt(document.getElementById("eMeng").style.top,10) <= (docHeight - divHeight + parseInt(document.body.scrollTop,10)))  {  window.clearInterval(objTimer)  }  else{  divTop = parseInt(document.getElementById("eMeng").style.top,10)  document.getElementById("eMeng").style.top = divTop - 1  //move up until =   }  }  catch(e){}}function closeDiv(){  document.getElementById('eMeng').style.visibility='hidden';  if(objTimer) window.clearInterval(objTimer)}function addRow()        {        //add one tr        var newTr = testTbl.insertRow();        //add two td        var newTd0 = newTr.insertCell();        newTd0.className="td6";        var newTd1 = newTr.insertCell();        newTd1.className="td6"        //add td innerHtml        newTd0.innerHTML = '銷售單產品 <input type=text name="product" class="textid"/> 數量 <input type=text name="product" class="textid1"/> 瓶';         newTd1.innerHTML= '&nbsp;';        }function addRow1()        {        //add one tr        var newTr = testTbl.insertRow();        //add two td        var newTd0 = newTr.insertCell();        newTd0.className="td6";        var newTd1 = newTr.insertCell();        newTd1.className="td6"        //add td innerHtml        newTd0.innerHTML = '退貨產品 <input type=text name="returned_type" class="textid"/> 數量 <input type=text name="returned_type" class="textid1"/> 瓶';         newTd1.innerHTML= '&nbsp;';        }function deleteRow(isTable){var c = document.getElementsByName('choiceStr');for(var i=0; i<c.length; i++)if(c[i].checked)if(confirm("是否確定刪除?")){isTable.deleteRow(i);document.ftpEditForm.total.value=document.ftpEditForm.total.value-1;}}function moreSend(){            XMLHttp.sendReq('GET', 'oaBlog.do?action=get', '', Blog);XMLHttp.sendReq('GET', 'oaDeclaration.do?action=get', '', Declaration);      XMLHttp.sendReq('GET', 'rss.do?action=wine', '', Rss);XMLHttp.sendReq('GET', 'oaMessage.do?action=get', '', Message);XMLHttp.sendReq('GET', 'oaPetition.do?action=get', '', Petition);XMLHttp.sendReq('GET', 'oaOrder.do?action=get', '', Order);XMLHttp.sendReq('GET', 'oaCustomer.do?action=get', '', Customer);XMLHttp.sendReq('GET', 'oaSchedule.do?action=get1', '', Schedule);sendRequest();}   function update(id,i){      var url="oaSchedule.do?action=update_remind&id="+id;      XMLHttp.sendReq('GET', url, '', Schedule_remind);//sendRequest();}   
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.