Subversion Repositories eFlore/Archives.eflore-xul

Rev

Rev 13 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 13 Rev 23
Line 6... Line 6...
6
timeOut = 120;
6
timeOut = 120;
7
DANS LA FONCTION APPELANT connection !!!
7
DANS LA FONCTION APPELANT connection !!!
8
*/
8
*/
Line 9... Line 9...
9
 
9
 
10
/* Use XMLHttpRequest to make a connection*/
10
/* Use XMLHttpRequest to make a connection*/
-
 
11
function connection( qString ) 
11
function connection( qString ) {
12
{
12
    /*Create the Object*/
13
    /*Create the Object*/
13
    try {
14
    try {
14
        var req = new XMLHttpRequest();
15
        var req = new XMLHttpRequest();
-
 
16
        req.overrideMimeType("text/xml");
15
        req.overrideMimeType("text/xml");
17
    }
16
    }catch (e){
18
    catch (e){
17
        alert('Error creating the connection!');
19
        alert('Erreur lors de la création de la connection!');
18
        return;
20
        return;
Line 19... Line 21...
19
    }
21
    }
20
 
22
 
Line 25... Line 27...
25
    }
27
        }
Line 26... Line 28...
26
 
28
        
27
    req.open("GET",qString,true);
29
        req.open("GET",qString,true);
Line -... Line 30...
-
 
30
        req.send(null);
28
    req.send(null);
31
        
29
 
32
    }
30
    } catch (e) {
33
    catch (e) {
31
        alert('An error has occured: '+e);
34
        alert('An error has occured: '+e);
Line 32... Line 35...
32
        return;
35
        return;
Line 47... Line 50...
47
        }
50
        }
48
    };
51
    };
Line 49... Line 52...
49
 
52
    
Line 50... Line 53...
50
    var intervalID =  setInterval(checkLoad,1000);
53
    var intervalID =  setInterval(checkLoad,1000);
-
 
54
    
51
 
55
    function stopConnection(e) 
52
    function stopConnection(e) {
56
    {
53
        if(e.keyCode == 27 && req) {
57
        if (e.keyCode == 27 && req) {
54
            reqAbort();
58
            reqAbort();
Line 55... Line 59...
55
        }
59
        }
-
 
60
    }
56
    }
61
 
57
 
62
    function reqAbort() 
58
    function reqAbort() {
63
    {
Line 59... Line 64...
59
        if(req) req.abort();
64
        if(req) req.abort();
-
 
65
        clearInterval(intervalID);
60
        clearInterval(intervalID);
66
    }
61
    }
67
 
62
 
68
    req.onload = function() 
63
    req.onload = function() {
69
    {
64
        switch(req.readyState) {
70
        switch(req.readyState) {