AJax¼¼Êõ

ajaxµÄ¶¨Ê±µ÷ÓÃÿ5Ãëµ÷ÓÃÒ»´Î£¬ajax5Ãëµ÷ÓÃ

×ÖºÅ+ ×÷ÕߣºH5Ö®¼Ò À´Ô´£ºH5Ö®¼Ò 2017-07-23 17:01 ÎÒÒªÆÀÂÛ( )

ajaxµÄ¶¨Ê±µ÷ÓÃÿ5Ãëµ÷ÓÃÒ»´Î£¬ajax5Ãëµ÷Óá£ajaxµÄ¶¨Ê±µ÷ÓÃÿ5Ãëµ÷ÓÃÒ»´Î£¬ajax5Ãëµ÷Óà ¸´ÖÆ´úÂë ´úÂëÈçÏÂ: function initXMLRequest(){ if (window.ActiveXObj

ajaxµÄ¶¨Ê±µ÷ÓÃÿ5Ãëµ÷ÓÃÒ»´Î£¬ajax5Ãëµ÷ÓÃ

¸´ÖÆ´úÂë ´úÂëÈçÏÂ:


function initXMLRequest(){
if (window.ActiveXObject) {
xmlRequest = new ActiveXObject("Microsoft.XMLHTTP");
} else {
if (window.XMLHttpRequest) {
xmlRequest = new XMLHttpRequest();
}
}

}

function sendHTTPRequest(){
initXMLRequest();
var url = "monitor!taskdata.action"; //µ÷ÓõÄservlet
if (xmlRequest) {
xmlRequest.open("POST", url, true);
xmlRequest.send(null);
xmlRequest.onreadystatechange = isDataExists;
//ʹÓ÷½·¨»Øµ÷£¬Ã¿5Ãëµ÷ÓÃÒ»´Î
setTimeout("sendHTTPRequest()",5000);
}

}

function isDataExists(){
if (xmlRequest.readyState == 4) {
if (xmlRequest.status == 200) {
var data = eval("("+xmlRequest.responseText+")");
// »ñÈ¡tbodyµÄ±í¸ñÄÚÈÝ
var taskTable = document.getElementById("tasktbody");
for(var i=taskTable.childNodes.length-1;i>=0;i--){
taskTable.removeChild(taskTable.childNodes[i]);
}
$.each(data, function(i,val){

var newTR = taskTable.insertRow(taskTable.rows.length);
newTR.id="taskdata_"+(i+1);
newTR.ondblclick=getdetail;
newTR.onclick=selectRow;
backColor(val.taskstatus,newTR);

var newNameTD=newTR.insertCell(0);
newNameTD.innerHTML = val.taskname;
newNameTD.id="taskname_"+(i+1);

var newStatusTD=newTR.insertCell(1);
newStatusTD.innerHTML = val.taskstatus;
newStatusTD.id="taskstatus_"+(i+1);

var newArgTD=newTR.insertCell(2);
newArgTD.innerHTML = val.data_start_time;

var newOtherArgTD=newTR.insertCell(3);
newOtherArgTD.innerHTML = val.schedule_interval;

var newdateformatTD=newTR.insertCell(4);
newdateformatTD.innerHTML = val.next_execution_time;

var newbackwordTD=newTR.insertCell(5);
newbackwordTD.innerHTML = val.taskdetailscount;

var newpriorityTD=newTR.insertCell(6);
newpriorityTD.innerHTML = val.statusruncount;

var newleftTD=newTR.insertCell(7);
newleftTD.innerHTML = val.statusfinishcount;

var newlefttimeTD=newTR.insertCell(8);
newlefttimeTD.innerHTML = val.statuserrorcount;
});

}
}
}


ÔõʵÏÖÔÚдһ¸öajax£¬Ã¿ÎåÃëÖÓ±»µ÷ÓÃÒ»´Î£¬·µ»Ø½á¹ûÊÇtrueµÄʱ£¬ÔòÔÚÍøÒ³ÓÒϽǵ¯³öÏûÏ¢¿ò

ÄãÕâÊÇҪЩȫ¾Öº¯Êýѽ£¬ÒÔÇ°ÎÒЩȫ¾Ö¶¼ÔÚglobal.asaxÀïÃæЩ£¬¶¼ÊÇһЩÊý¾Ý¿âµÄÊý¾Ý²Ù×÷£¬ÄãÏÖÔÚÐèÒªAjaxÒì²½»¹µÃµ¯³ö¶Ô»°¿òÀ´²»ÖªµÀÔÚÕâ¸öÎļþÀïÊÇ·ñ¹ÜÓÃÁË£¬·´ÕýÎÒÊÇûÊÔ¹ý¡£

ÏÖÔÚÄØ£¬Ò³Ã涼ÓÐÒ»¸ö´ó¿ò¼Ü£¬¾ÍÊÇÄ£°æ£¬ËùÒÔËùÓеÄÒ³Ã涼»áµ÷ÓÃÄ£°æÀïµÄÄÚÈÝ¡£Ò²¾ÍÊÇ˵Ä㽫ajaxµÄÇëÇóÏûÏ¢µÄ²¼¾ÖÒÔ¼°²Ù×÷È«¶¼Ð´ÔÚÄ£°æÀïÃ棬ȻºóÉèÖÃÿ¸ôÎåÃëÖÓ¾ÍÖ´ÐÐÒ»´ÎÏûÏ¢£¬½øÐе¯¿ò¾Í¿ÉÒÔÁË¡£

Èç¹ûÄãÖ»ÓÐÒ»¸öÒ³Ã棬ÄÇÄã¾ÍÖ±½Óдµ½Õâ¸öÒ³ÃæÀïÃæ¾ÍÍêÊ´ó¼ªÁË

Ã÷°×ÁËô£¿

ÓÃjavaµÄQuartz°ü¶¨Ê±µ÷Ó÷½·¨£¬ÎÒÏëʵÏÖÿ¸ô°ëСʱµ÷ÓÃÒ»´Î·½·¨£¬ÄǸöÅäÖÃÎļþÖÐʱ¼äµÄÅäÖ÷ûºÅզдµÄÁË

<!-- ³£ÓõÄcorn±í´ïʽ
*¸ô5ÃëÖ´ÐÐÒ»´Î£º*/5 * * * * ?
*¸ô1·ÖÖÓÖ´ÐÐÒ»´Î£º0 */1 * * * ?
*23µãÖ´ÐÐÒ»´Î£º0 0 23 * * ?
*³¿1µãÖ´ÐÐÒ»´Î£º0 0 1 * * ?
*ÔÂ1ºÅÁ賿1µãÖ´ÐÐÒ»´Î£º0 0 1 1 * ?
*ÔÂ×îºóÒ»Ìì23µãÖ´ÐÐÒ»´Î£º0 0 23 L * ?
*ÖÜÐÇÆÚÌìÁ賿1µãʵÐÐÒ»´Î£º0 0 1 ? * L
*ÔÚ26·Ö¡¢29·Ö¡¢33·ÖÖ´ÐÐÒ»´Î£º0 26,29,33 * * * ?
*µÄ0µã¡¢13µã¡¢18µã¡¢21µã¶¼Ö´ÐÐÒ»´Î£º0 0 0,13,18,21 * * ?
-->

ÕâÊÇspringµ÷ÓÃʱ£¬µÄ·ûºÅ¹«Ê½

¡¡

1.±¾Õ¾×ñÑ­ÐÐÒµ¹æ·¶£¬ÈκÎתÔصĸå¼þ¶¼»áÃ÷È·±ê×¢×÷ÕߺÍÀ´Ô´£»2.±¾Õ¾µÄÔ­´´ÎÄÕ£¬ÇëתÔØʱÎñ±Ø×¢Ã÷ÎÄÕÂ×÷ÕߺÍÀ´Ô´£¬²»×ðÖØÔ­´´µÄÐÐΪÎÒÃǽ«×·¾¿ÔðÈΣ»3.×÷ÕßͶ¸å¿ÉÄܻᾭÎÒÃDZ༭Ð޸Ļò²¹³ä¡£

Ïà¹ØÎÄÕÂ
  • ºÜºÃµÄÒ»¸öajax·ÖҳʵÀý´úÂë

    ºÜºÃµÄÒ»¸öajax·ÖҳʵÀý´úÂë

    2017-07-23 17:00

  • ajaxʹÓò»Í¬namespaceµÄactionµÄ·½·¨£¬ajaxnamespace

    ajaxʹÓò»Í¬namespaceµÄactionµÄ·½·¨£¬ajaxnamespace

    2017-07-23 16:06

  • ͼ½âAJAXÔ­Àí

    ͼ½âAJAXÔ­Àí

    2017-07-23 16:03

  • AJAXºËÐļ¼Êõ½Ìѧ

    AJAXºËÐļ¼Êõ½Ìѧ

    2017-07-23 14:02

ÍøÓѵãÆÀ
¥