--- alx-src/branches/alx-web-060/openclose_ajax.js 2011/05/09 16:31:38 2017 +++ alx-src/branches/alx-web-070/openclose_ajax.js 2016/02/08 10:37:04 8531 @@ -3,56 +3,54 @@ * * @return xmlhttprequest object or false */ -function getXMLRequester( ) +function getXMLRequester() { - var xmlHttp = false; + var xmlHttp = false; - // try to create a new instance of the xmlhttprequest object - try - { - // Internet Explorer - if( window.ActiveXObject ) - { - for( var i = 5; i; i-- ) - { - try - { - // loading of a newer version of msxml dll (msxml3 - msxml5) failed - // use fallback solution - // old style msxml version independent, deprecated - if( i == 2 ) - { - xmlHttp = new ActiveXObject( "Microsoft.XMLHTTP" ); - } - // try to use the latest msxml dll - else - { - - xmlHttp = new ActiveXObject( "Msxml2.XMLHTTP." + i + ".0" ); - } - break; - } - catch( excNotLoadable ) - { - xmlHttp = false; - } - } - } - // Mozilla, Opera und Safari - else if( window.XMLHttpRequest ) - { - xmlHttp = new XMLHttpRequest(); - } - } - // loading of xmlhttp object failed - catch( excNotLoadable ) - { - xmlHttp = false; - } - return xmlHttp ; + // try to create a new instance of the xmlhttprequest object + try + { + // Internet Explorer + if( window.ActiveXObject ) + { + for( var i = 5; i; i-- ) + { + try + { + // loading of a newer version of msxml dll (msxml3 - msxml5) failed + // use fallback solution + // old style msxml version independent, deprecated + if( i == 2 ) + { + xmlHttp = new ActiveXObject( "Microsoft.XMLHTTP" ); + } + // try to use the latest msxml dll + else + { + xmlHttp = new ActiveXObject( "Msxml2.XMLHTTP." + i + ".0" ); + } + break; + } + catch( excNotLoadable ) + { + xmlHttp = false; + } + } + } + // Mozilla, Opera und Safari + else if( window.XMLHttpRequest ) + { + xmlHttp = new XMLHttpRequest(); + } + } + // loading of xmlhttp object failed + catch( excNotLoadable ) + { + xmlHttp = false; + } + return xmlHttp ; } - function sendopenclose(section, opened) { var xmlHttp = getXMLRequester(); @@ -65,4 +63,4 @@ // send request to server xmlHttp.send( null ); // param = POST data } -} \ No newline at end of file +}