Magellan Linux

Annotation of /alx-src/tags/alx-web-0_7_0_20181113_1/openclose_ajax.js

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2190 - (hide annotations) (download) (as text)
Tue Jun 7 13:05:49 2011 UTC (12 years, 11 months ago) by niro
Original Path: alx-src/branches/alx-web-060/openclose_ajax.js
File MIME type: application/javascript
File size: 1357 byte(s)
-fixed whitepaces
1 niro 1610 /**
2     * instantiates a new xmlhttprequest object
3     *
4     * @return xmlhttprequest object or false
5     */
6 niro 2190 function getXMLRequester()
7 niro 1610 {
8 niro 2190 var xmlHttp = false;
9 niro 1610
10 niro 2190 // try to create a new instance of the xmlhttprequest object
11     try
12     {
13     // Internet Explorer
14     if( window.ActiveXObject )
15     {
16     for( var i = 5; i; i-- )
17     {
18     try
19     {
20     // loading of a newer version of msxml dll (msxml3 - msxml5) failed
21     // use fallback solution
22     // old style msxml version independent, deprecated
23     if( i == 2 )
24     {
25     xmlHttp = new ActiveXObject( "Microsoft.XMLHTTP" );
26     }
27     // try to use the latest msxml dll
28     else
29     {
30     xmlHttp = new ActiveXObject( "Msxml2.XMLHTTP." + i + ".0" );
31     }
32     break;
33     }
34     catch( excNotLoadable )
35     {
36     xmlHttp = false;
37     }
38     }
39     }
40     // Mozilla, Opera und Safari
41     else if( window.XMLHttpRequest )
42     {
43     xmlHttp = new XMLHttpRequest();
44     }
45     }
46     // loading of xmlhttp object failed
47     catch( excNotLoadable )
48     {
49     xmlHttp = false;
50     }
51     return xmlHttp ;
52 niro 1610 }
53    
54     function sendopenclose(section, opened)
55     {
56     var xmlHttp = getXMLRequester();
57    
58     if(xmlHttp!=null)
59     {
60     // open the connection
61     xmlHttp.open( 'GET', 'openclose.php?section='+section+'&opened='+opened, true );
62    
63     // send request to server
64     xmlHttp.send( null ); // param = POST data
65     }
66 niro 2190 }

Properties

Name Value
svn:executable *