Ajax asynchronous request refresh and ajax asynchronous refresh

Source: Internet
Author: User

Ajax asynchronous request refresh and ajax asynchronous refresh

In the website refresh method, ajax refresh is a refreshing method with good user experience. It is a popular framework that integrates ssh and other technologies! Most commonly used! The following is a demo of a commonly used ajax refresh form.

$ (Document ). ready (function () {testchaxun (); setInterval ("testchaxun ()", 5000) ;}); function testchaxun () {/* var selectId = $ ('# proviace '). val (); */$. ajax ({type: "POST",/* cache: false, */url: "WarningAction! WarningdefQuery1.action ", dataType:" json ", success: function (data) {$ ('tr '). remove ('. dataz'); for (var I = 0; I <data. length; I ++) {if (data [I]. pState = 'hazardous ') {$ ('. table-thtr '). after ('<tr class = "datrecognition error-tr">' + '<td>  </td>' + '<td>' + data [I]. pName + '</td>' + '<td>' + data [I]. uName + '</td>' + '<td>' + data [I]. bHomenum + '</td>' + '<td>' + data [I]. bNumber + '</td>' + '<td> '+ Data [I]. eStart + '</td>' + '<td>' + data [I]. wType + '</td>' + '<td>' + data [I]. wTime + '</td>' + '<td>' + data [I]. pAddress + '</td>' + '<td>' + data [I]. uName + '</td>' + '<td>' + data [I]. pState + '</td>' + '<td> <a href = "WarningAction! WaringInfor. action? WId = '+ data [I]. wId + '"> details </a> </td>' + '</tr>');} else {$ ('. table-thtr '). after ('<tr class = "datrecognition">' + '<td>  </td>' + '<td>' + data [I]. pName + '</td>' + '<td>' + data [I]. uName + '</td>' + '<td>' + data [I]. bHomenum + '</td>' + '<td>' + data [I]. bNumber + '</td>' + '<td>' + data [I]. eStart + '</td>' + '<td>' + data [I]. wType + '</td>' + '<td>' + data [I]. wTime + '</td>' + '<td>' + data [I]. pAddress + '</t D> '+' <td> '+ data [I]. uName + '</td>' + '<td>' + data [I]. pState + '</td>' + '<td> <a href = "WarningAction! WaringInfor. action? WId = '+ data [I]. wId + '"> details </a> </td>' + '</tr>') ;}}}) ;</script>

WarningAction in the background! Two parameters are transferred in waringInfor. action to Implement the necessary conditions for requesting this method! Returns a json

public String waringInfor(){     w= warningService.getWarningByWid(WId);     if (w!=null) {       if (w.getPId()!=null) {       p =patientService.getPatientByPId(w.getPId());      }    }    if (p!=null) {      if (p.getPId()!=null) {        s= sickroomService.getSickroomByPid(p.getPId());      }      if (p.getPEquipmentid()!=null) {        e= equipmentService.getEquipmentByEId(p.getPEquipmentid());       }    }    return "waringInfor";  };

The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.

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.