Bonjour

J'ai un formulaire qui envoie des données à un serveur NodeJs avec Express.js en utilisant fetch. Du côté client, lorsque je veux afficher les résultats de l'appel d'extraction une fois l'opération terminée, rien ne s'affiche (et il n'atteint jamais le rappel de données). Je reçois un message d'erreur (TypeError: NetworkError when attempting to fetch resource.), mais je sais que les données ont bien été envoyées au serveur.

JS file :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
function trajDisplay2() {
  balMarkers = [];
  airports = [];
  airport_names = [];
  var date2 = $("#date").val().split('/').reverse().join("");
  var callsignField2 = $('#callsign');
  var departField2 = $('#depart');
  var arriveeField2 = $('#arrivee');
  var trajRequest2 = '/api/data/v3/traj' + '/cpr' + '?';
  var trajParams2 = $.param({
    'ddebut': date2,
    'callsign': callsignField2.val().toUpperCase(),
    'fields': ['callsign', 'acft'].toString(),
    'dep': departField2.val().toUpperCase() ,
    'arr': arriveeField2.val().toUpperCase(),
    'pp': ['coord', 'alti', 'time'].toString(),
  });
 
   fetch(trajRequest2 + trajParams2, {
        origin:'https://farol.per.ath/',
        mode:'cors',
        credentials: 'include'
    })
    .then(function(resp) {
      if (!response.ok) {
            throw Error(response.statusText);
          }      return resp.json();
    })
    .then(function(json) {
      var trajid2, callsign2, bal2, sect2, time2, distance2, alti2;
      var all_data2 = json.list;
      dataTrajfilter2 = all_data2;
      console.log(dataTrajfilter2);
Jade File :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
extends layout
 
block headcontent
  link(rel='stylesheet', href='/stylesheets/external/leaflet.css')
  link(rel='stylesheet', href='/stylesheets/external/leaflet-ruler.css')
  link(rel='stylesheet', href='/stylesheets/external/MousePosition.css')
  link(rel='stylesheet', href='/stylesheets/per/custom_popup.css')
  link(rel='stylesheet', href='/stylesheets/external/jquery-ui.min.css')
  link(rel='stylesheet', href='/stylesheets/external/sidenavi-left.css')
  link(rel='stylesheet', href='/stylesheets/external/timepicker.css')
  link(rel='stylesheet', href='/stylesheets/external/Control.FullScreen.css')
  link(rel='stylesheet', href='/stylesheets/external/leaflet-slider.css')
  //link(rel='stylesheet', href='https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css')
  link(rel='stylesheet', href='/stylesheets/external/L.Control.SlideMenu.css')
  link(rel='stylesheet', href='/stylesheets/external/L.Control.MousePosition.css')
  link(rel='stylesheet', href='/stylesheets/external/bootstrap.min.css')
  //link(href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.css" rel="stylesheet" type="text/css")
  link(href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css", rel="stylesheet", integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN", crossorigin="anonymous")
  link(rel='stylesheet', href='https://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css')
  //link(rel='stylesheet', href='https://code.jquery.com/jquery-3.3.1.min.css')
  link(rel='stylesheet', href='/stylesheets/external/tabulator.min.css')
 
  script(src='https://code.jquery.com/jquery-1.12.4.min.js')
  script(src='https://code.jquery.com/jquery-2.2.4.min.js')
  script(src='/javascripts/external/SideNavi.js')
  script(src='/javascripts/external/leaflet.js')
  script(src='/javascripts/external/leaflet-slider.js')
  script(src='/javascripts/external/jquery.preloaders.js')
  script(src='/javascripts/external/jquery-ui.min.js')
  script(src='/javascripts/external/popper.js')
  script(src='/javascripts/external/bootstrap.min.js')
  script(src='/javascripts/external/leaflet-simple-map-screenshoter.js')
  script(src='/javascripts/external/mousetrap.min.js')
  script(src='/javascripts/external/L.Control.MousePosition.js')
  script(src='/javascripts/external/leaflet-ruler.js')
  script(src='/javascripts/external/jquery.timepicker.js')
  script(src='/javascripts/external/d3.v3.js')
  script(src='/javascripts/external/Control.FullScreen.js')
  script(src='/javascripts/external/tabulator.min.js')
 
 
block content
 
  div(class="container-fluid" id="top" )
 
     div(class="row pb-2")
       div(id="mapid" class="custom-popup"  style="position: fixed; width: 100%; height: 95%;")
 
  #sideNavi
        // sidenavi menu //
        .side-navi-item-default
        .side-navi-item.item1
          div Set 1
        .side-navi-item.item2
          div Set 2
        .side-navi-item.item3
          div Set 3
        // sidenavi data //
        .side-navi-data
          .side-navi-tab
            .row
              h5.display-6 Select the flights
            ul#myTab.nav.nav-tabs.tab
              li.nav-item
                a#standard-tab.nav-link.active(data-toggle='tab' href='#standard' role='tab' aria-controls='standard' aria-selected='true') Standard Criteria
              li.nav-item
                a#advanced-tab.nav-link(data-toggle='tab' href='#advanced' role='tab' aria-controls='advanced' aria-selected='false') Advanced Criteria
              li.nav-item
                a#ifps-tab.nav-link(data-toggle='tab' href='#ifps' role='tab' aria-controls='ifps' aria-selected='false') IFPS-ID Criteria
            #myTabContent.tab-content
              #standard.tab-pane.fade.show.active(role='tabpanel' aria-labelledby='standard-tab')
                    table.TabFiltre1
                    form(id="formparm")
                      tbody
                        tr
                          div.form-group
                            td
                              input(class='form-control datepicker' type='text' id='date')
                        tr
                          div.form-group
                            td
                              input(class='form-control' type='text' id='depart', placeholder='LFPG, LFPO')
                        tr
                          div.form-group
                            td
                              input(class='form-control' type='text' id='arrivee', placeholder='LFPG, LFPO')
                        tr
                          div.form-group
                            td
                              input(class='form-control' type='text' id='callsign' ,placeholder='AFR*')
                        tr
                          div.form-group
                            td
                              button(type="button" class="btn  btn-sm form-submit" id="prev" value="prev") <
                              button(class='btn btn-primary btn-success form-submit' type='submit' value ="btt" id='current') Go
                              button(type="button" class="btn  btn-sm form-submit" id="next" value="next") >
Nom : New Project.jpg
Affichages : 22
Taille : 27,9 Ko

Merci pour l'aide