Bonjour tout le monde.

J'ai un petit soucis avec un script ajax avec les htmlhttprequest.
Le script fonctionne très bien sous firefox, mais IE quitte violemment, sans message d'erreur au bout de quelques clic.
Ce que je trouv bizarre c'est que c'est aléatoire: ça peu buguer des le premier clic, ou au bout de la 5-10em fois...
Plus je clic vite, plus ça bug vite ^^

getHeader est appelé dans getContent.

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
 
function getContent(parent_id) {
  var width = get_width('ged_title')-150;
  if(!parent_id){var parent_id='ged_0';}
  if(_xmlHttp&&_xmlHttp.readyState!=0) {
    _xmlHttp.abort()
  }
  _xmlHttp=getXMLHTTP();
  if(_xmlHttp) {
    _xmlHttp.open("GET","composants/ged/ged.php?parent="+parent_id+"&width="+width ,true);
    _xmlHttp.onreadystatechange=function() {
      if(_xmlHttp.readyState==4&&_xmlHttp.responseText) {
        document.getElementById( 'ged_content' ).innerHTML = _xmlHttp.responseText ;
        document.getElementById( 'ged_propriety' ).innerHTML = '' ;
        getHeader(parent_id);
        if (document.getElementById( 'ged_content' ).offsetHeight > 150) {
          document.getElementById( 'ged_arbo' ).style.height = document.getElementById( 'ged_content' ).offsetHeight + "px";
        }
        else {
          document.getElementById( 'ged_arbo' ).style.height = "150px";
        }
      }
    };
    _xmlHttp.send(null)
  }
}
 
function getHeader(id) {
  var _adresseRecherche = "composants/ged/path.php";
  if(_xmlHttp&&_xmlHttp.readyState!=0) {
    _xmlHttp.abort()
  }
  _xmlHttp=getXMLHTTP();
  if(_xmlHttp) {
    _xmlHttp.open("GET",_adresseRecherche+"?id="+id ,true);
    _xmlHttp.onreadystatechange=function() {
      if(_xmlHttp.readyState==4&&_xmlHttp.responseText) {
        document.getElementById( 'ged_title' ).innerHTML = _xmlHttp.responseText ;
      }
    };
    _xmlHttp.send(null)
  }
}
Merci Beaucoup