Achieved through javascript && ajax partial refresh

Use the form below:

showli_1 function () {                                              // trigger function by a button the onclick    
    var XMLHTTP = new new the XMLHttpRequest (); 
    xmlhttp.open ( "the GET", "/ ajax_js_war_exploded / EmpServlet In Flag. 1 =?", to true ); // definitions are uploaded, Servlet and be transmitted? After the addition of the data to be transmitted between the data separated by commas, whether defined as asynchronous 
    xmlhttp.send ();   // send a request 
    xmlhttp.onreadystatechange = function () {        // function after a successful interaction triggered 
      IF (XMLHTTP == ==. 4 && xmlhttp.status .readyState 200 is) {   // receiving the server response (readyState = 4 indicates that the request is complete and ready response to a request response status = 200 represents all normal) 
        document.getElementsByClassName ( "First") [0] .innerHTML = xmlhttp.responseText;        responseText returns a string data type 
    } 
    } 
  }                    

Guess you like

Origin www.cnblogs.com/shouyaya/p/12044405.html