Magellan Linux

Contents of /alx-src/branches/alx-web-050/openclose_ajax.js

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1610 - (show annotations) (download) (as text)
Thu Dec 2 23:02:19 2010 UTC (13 years, 4 months ago) by niro
File MIME type: application/javascript
File size: 1791 byte(s)
-converted to unix cr/lf
1 /**
2 * instantiates a new xmlhttprequest object
3 *
4 * @return xmlhttprequest object or false
5 */
6 function getXMLRequester( )
7 {
8 var xmlHttp = false;
9
10 // 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
31 xmlHttp = new ActiveXObject( "Msxml2.XMLHTTP." + i + ".0" );
32 }
33 break;
34 }
35 catch( excNotLoadable )
36 {
37 xmlHttp = false;
38 }
39 }
40 }
41 // Mozilla, Opera und Safari
42 else if( window.XMLHttpRequest )
43 {
44 xmlHttp = new XMLHttpRequest();
45 }
46 }
47 // loading of xmlhttp object failed
48 catch( excNotLoadable )
49 {
50 xmlHttp = false;
51 }
52 return xmlHttp ;
53 }
54
55
56 function sendopenclose(section, opened)
57 {
58 var xmlHttp = getXMLRequester();
59
60 if(xmlHttp!=null)
61 {
62 // open the connection
63 xmlHttp.open( 'GET', 'openclose.php?section='+section+'&opened='+opened, true );
64
65 // send request to server
66 xmlHttp.send( null ); // param = POST data
67 }
68 }

Properties

Name Value
svn:executable *