1 /***************************************************************************
2 * Copyright (C) 2003-2007 Polytechnique.org *
3 * http://opensource.polytechnique.org/ *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the Free Software *
18 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
19 ***************************************************************************/
25 prepare_client
: function()
28 if (window
.XMLHttpRequest
) {
29 Ajax
.xml_client
= new XMLHttpRequest();
30 } else if (window
.ActiveXObject
) {
32 Ajax
.xml_client
= new ActiveXObject("Msxml2.XMLHTTP");
34 Ajax
.xml_client
= new ActiveXObject("Microsoft.XMLHTTP");
37 if (Ajax
.xml_client
== null) {
38 alert("Ton client ne supporte pas Ajax, nécessaire pour certaines fonctionalités de cette page");
44 update_html
: function(obj
, src
)
46 Ajax
.prepare_client();
47 if (Ajax
.xml_client
== null) {
50 Ajax
.xml_client
.abort();
51 Ajax
.xml_client
.onreadystatechange
= function()
53 if(Ajax
.xml_client
.readyState
== 4) {
54 if (Ajax
.xml_client
.status
== 200) {
56 document
.getElementById(obj
).innerHTML
= Ajax
.xml_client
.responseText
;
58 } else if (Ajax
.xml_client
.status
== 403) {
59 window
.location
.reload();
63 Ajax
.xml_client
.open ('GET', src
, true);
64 Ajax
.xml_client
.send (null);