My own Ajax JS files.

Source: Internet
Author: User

VaR xmlhttpreq = false;

Function createxmlhttprequest () {If (window. XMLHttpRequest) {// determine if it is 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 ("calendar Information read timeout") ;}} function show () {var IDs = xmlhttpreq. responsexml. getelementsbytagname ("ID"); VA R 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. n Odevalue); // 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 = 'click to View Details 'href = 'oss edule. do? Action = show '> <font color = 'red'> "+ contents [I]. firstchild. nodevalue + "</font> </a> </br> </BR>" + // "<a href = 'oaschedule. do? Action = updat'> "+" no longer prompting "+" </a> "url1 + =" <a Title = 'click to View Details '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); '>" + "no longer prompts" + "</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 = parsein T (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) docum Ent. 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. g Etelementbyid ("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 = parse INT (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 = 'den den '; 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 = 'sales order product <input type = text name = "product" class = "textid"/> quantity <input type = text name = "product" class = "textid1"/> bottle '; 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. insertc Ell (); newtd1.classname = "td6" // Add TD innerhtml newtd0.innerhtml = 'Return product <input type = text name = "returned_type" class = "textid"/> quantity <input type = text name = "returned_type" class = "textid1"/> bottle '; 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 ("are you sure you want to delete it? ") {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', 'adeclaration. 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', 'oa order. Do? Action = Get ', '', order); XMLHTTP. sendreq ('get', 'oacustomer. do? Action = Get ', '', customer); XMLHTTP. sendreq ('get', 'oss edule. 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 ();}
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.