Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2190 - (show annotations) (download) (as text)
Tue Jun 7 13:05:49 2011 UTC (12 years, 10 months ago) by niro
File MIME type: application/javascript
File size: 1357 byte(s)
-fixed whitepaces
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 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 }
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 }

Properties

Name Value
svn:executable *