javaee_ajax/src/main/webapp/Resources/js/app_jQuery.js
/*
   * Retrieving data from the server -> XML data
   */
Retrieving data from the server -> XML data
Retrieving data from the server - > XML data
function loadXmlData(link) {
    var spin_btn = $("#spin_btn_get");
    spin_btn.show();
    var jxhttp = $.get(
      link,
      function (xmldata) {
        $("#table_content").html("");
        $(xmldata)
          .find("personne")
          .each(function () {
            $("#table_content").append(`<tr>
                            <td>${$(this).find("nom").text()}</td>
                            <td>${$(this).find("prenom").text()}</td>
                            <td>${$(this).find("fonction").text()}</td>
                        </tr>`);
          });
      },
      "xml"
    );
    jxhttp.fail(function () {
      alert("Impossible de récupérer les données !");
    });
    jxhttp.always(function () {
      spin_btn.hide();
    });
  }
function loadXmlData ( link ) { var spin_btn = $ ( "#spin_btn_get" ) ; spin_btn . show ( ) ; var jxhttp = $ . get ( link , function ( xmldata ) { $ ( "#table_content" ) . html ( "" ) ; $ ( xmldata ) . find ( "personne" ) . each ( function ( ) { $ ( "#table_content" ) . append ( ` ${ $ ( this ) . find ( "nom" ) . text ( ) } ${ $ ( this ) . find ( "prenom" ) . text ( ) } ${ $ ( this ) . find ( "fonction" ) . text ( ) } ` ) ; } ) ; } , "xml" ) ; jxhttp . fail ( function ( ) { alert ( "Impossible de récupérer les données !"); } ) ; jxhttp . always ( function ( ) { spin_btn . hide ( ) ; } ) ; }
Retrieving data from the server -> XML data
Retrieving data from the server - > XML data